]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rgw: avoid doubled ARN in GetBucketReplication for pre-existing data 68137/head
authorLumir Sliva <lumir.sliva@firma.seznam.cz>
Tue, 31 Mar 2026 15:04:16 +0000 (17:04 +0200)
committerLumir Sliva <lumir.sliva@firma.seznam.cz>
Tue, 31 Mar 2026 15:04:16 +0000 (17:04 +0200)
commitf7e82e9f8a9e522ff5e8a05bff72069c004054d8
tree57b4d9fe757dedf83857261677a09edc82ad9bb3
parentbeaff8408d500ae192b25141c026589ca38eb50c
rgw: avoid doubled ARN in GetBucketReplication for pre-existing data

Before commit b8f89327e1a ("rgw: handle destination bucket as an ARN
in ReplicationConfiguration"), the PutBucketReplication handler stored
the full ARN string (e.g. "arn:aws:s3:::bucket") as the bucket name
in the sync policy.  After that commit, the GetBucketReplication
handler wraps the stored bucket name in a new ARN via
ARN(rgw_bucket).to_string(), which produces a doubled prefix like
"arn:aws:s3:::arn:aws:s3:::bucket" for buckets whose replication was
configured before the fix.

Detect whether the stored bucket name is already a valid S3 ARN and
use it directly instead of wrapping it again.  New data written after
b8f89327e1a stores only the bare bucket name, so the else branch
handles that case unchanged.

Fixes: https://tracker.ceph.com/issues/75770
Signed-off-by: Lumir Sliva <lumir.sliva@firma.seznam.cz>
src/rgw/rgw_rest_s3.cc