Repository navigation
rgw: avoid doubled ARN in GetBucketReplication for pre-existing data - #68137
Conversation
Before commit b8f8932 ("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 b8f8932 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 <[email protected]>
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok to test" to allow the Jenkins jobs to run. |
13 similar comments
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok to test" to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok to test" to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok to test" to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok to test" to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok to test" to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok to test" to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok to test" to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok to test" to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok to test" to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok to test" to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok to test" to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok to test" to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok to test" to allow the Jenkins jobs to run. |
|
I can confirm that this fixes the issue (this PR cherry-picked on top of v20.2.0, including several other patches). |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
I'm trying to find whether this is the only effect and not affecting matching and bucket loading. Was your testing successful with all syncs and permission checks? |
I'm afraid I'm not entirely the right person to ask that question. In terms of permission checks any access from IAM subkeys does work correctly, and unauthenticated access is denied, however I haven't tested beyond that (i.e. no authenticated access from credentials without permission or testing for permissions other than GET/PUT basically). Note that all of those tests of mine were very much on the surface of a cluster running in production, so while the results are authentic, I didn't get any debug output for the respective requests or such. |
The change is scoped entirely to the What the fix does: before serializing, it checks whether For additional confidence, I can add a round-trip integration test along the lines of the existing
Happy to add those if it would help move this forward. |
|
pr testing is in progress .. |
pr testing completed : https://tracker.ceph.com/issues/76520 , and approved by @ivancich. |
|
jenkins test dashboard |
|
jenkins test dashboard cephadm |
|
jenkins test rook e2e |
Before commit b8f8932 ("rgw: handle destination bucket as an ARN
in ReplicationConfiguration"),
PutBucketReplicationstored the fullARN string (e.g.
arn:aws:s3:::bucket) as the bucket name in the syncpolicy. After that commit,
GetBucketReplicationwraps the storedbucket name in a new ARN via
ARN(rgw_bucket).to_string(), whichproduces a doubled prefix like
arn:aws:s3:::arn:aws:s3:::bucketforbuckets whose replication was configured before the fix.
This makes the GET-then-PUT workflow impossible — the doubled ARN is
rejected as invalid input on subsequent PUT requests.
The fix detects whether the stored bucket name is already a valid S3
ARN and uses it directly, avoiding the double-wrapping. New data
written after b8f8932 stores only the bare bucket name, so the
else branch handles that case unchanged.
How to reproduce
a zonegroup-level sync group so the S3 Replication API is enabled.
PutBucketReplicationwith destinationarn:aws:s3:::dest-bucket.dest.bucket = "arn:aws:s3:::dest-bucket"insync_policy.GetBucketReplication— the destination bucket ARN is nowarn:aws:s3:::arn:aws:s3:::dest-bucket.Verified on a squid 19.2.2 cluster.
Fixes: https://tracker.ceph.com/issues/75770
Checklist