Repository navigation
tentacle: rgw: redirect to the endpoint of the bucket's zonegroup - #71522
Conversation
rgw_build_bucket_policies() returns ERR_PERMANENT_REDIRECT when a request reaches a zonegroup that does not hold the bucket, but s->zonegroup_endpoint was read from the local zonegroup. abort_early() builds the Location header from that endpoint, so the client was redirected back to the gateway it had just used. Clients that follow redirects then retry in a tight loop. Look the bucket's zonegroup up in the current period and take the endpoint from there instead. If that zonegroup is not part of the period, leave the endpoint empty and log the reason rather than pointing the client at itself. This also restores Request.ZoneGroup.Name and Request.ZoneGroup.Endpoint in lua scripts to the bucket's zonegroup, which is what they reported before the endpoint lookup was dropped. Fixes: http://tracker.ceph.com/issues/64983 Fixes: e2eb66a Signed-off-by: ramin.najarbashi <[email protected]> (cherry picked from commit 7652d66)
Add unittest_rgw_zone for rgw::get_zonegroup_endpoint() and the new rgw::find_zonegroup_by_id(), including the case that caused the redirect loop: a bucket in another zonegroup must resolve to that zonegroup's endpoint and not the local one. Signed-off-by: ramin.najarbashi <[email protected]> (cherry picked from commit 19ecc26)
|
Thank you for your contribution. Since you are not yet a member of the Ceph organization with write permissions on ceph/ceph.git, our CI will not automatically run. Any member of the Ceph organization may label this PR |
|
@ceph/ceph-release-manager @adamemerson — sorry for the tracker linkage noise on this backport. After a fix lands on I do not have maintainer-level tracker access. I can create issues and set some fields on issues I own, but I cannot reliably wire up the parent/backport relations or update fields on the original bug tracker that releng-audit expects. That led to duplicate parent trackers and backport issues that are not linked the way the audit checks for. I am adjusting my local backport workflow so I wait for the official Upkeep backport trackers (or ask a maintainer to link them) before opening stable PRs, instead of creating parallel tracker entries on my own. Thanks for your patience, and sorry for the extra cleanup for release managers. Happy to adjust anything else that would help get this merged. |
|
This PR has been added to tentacle integration testing by anuchaithra started 2026-09-10-10:17. |
pr testing completed and approved by @ivancich , more details : https://tracker.ceph.com/issues/80447 |
Summary
Backport of #70931 to tentacle.
When a request for a bucket in another zonegroup reaches a gateway,
rgw_build_bucket_policies()returnsERR_PERMANENT_REDIRECT, buts->zonegroup_endpointwas taken from the local zonegroup. TheLocationheader then pointed clients back at the same gateway, causingredirect loops in multi-zonegroup deployments (tracker #64983).
Add
rgw::find_zonegroup_by_id()and use the bucket's zonegroup endpointfor the redirect instead.
Why tentacle: the regression (e2eb66a) is present on tentacle; multi-zonegroup
RGW deployments hit the same redirect loop fixed on main.
Minimal change: cherry-pick of both commits from PR #70931 with
git cherry-pick -x.No manual conflict resolution was required.
Original bug: https://tracker.ceph.com/issues/80245
Main PR: #70931 (merged as ea93efc)
Official backport tracker: https://tracker.ceph.com/issues/80265
Testing
unittest_rgw_zone(from main PR)Contribution Guidelines
Checklist
Fixes: https://tracker.ceph.com/issues/80265