Repository navigation
umbrella: rgw: redirect to the endpoint of the bucket's zonegroup - #71524
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. |
|
/audit retest |
|
🔄 Audit Retest Triggered by @RaminNietzsche. |
|
@RaminNietzsche could you please use ceph-backport.sh for these backports? Please note that any deviation in the commits, do need to be noted with a "Conflict:" statement in the commit and the changes made for the commit to pass that conflict. |
|
/audit restart |
|
🔄 Audit Retest Triggered by @RaminNietzsche. |
|
@RaminNietzsche you need to change the status of https://tracker.ceph.com/issues/80267 to be 'pending review' then add the PR number to it. |
|
@mheler I don't appear to have permission to update the Backport tracker fields on https://tracker.ceph.com/issues/80267 — I can't set Status to Pending Review or fill in Pull request ID (71524). Could you update those fields, or point me to how to get the needed tracker permissions? Thanks. |
|
This PR has been added to umbrella integration testing by anuchaithra started 2026-09-10-10:14. |
Summary
Backport of #70931 to umbrella.
In multi-zonegroup deployments, a request for a bucket that lives in another
zonegroup can reach a gateway that does not hold the bucket.
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 (see tracker #64983).
Add
rgw::find_zonegroup_by_id()and use the bucket's zonegroup endpointfor the redirect instead. If that zonegroup is not part of the current
period, leave the endpoint empty and log the reason.
Why umbrella: the regression (e2eb66a) is present on umbrella; the same
redirect loop fixed on main affects multi-zonegroup RGW deployments here.
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/64983
Main PR: #70931 (merged as ea93efc)
Official backport tracker: https://tracker.ceph.com/issues/80267
Testing
unittest_rgw_zone(cherry-picked from main PR)make checkpassed (ceph-pr-pipeline/568)Contribution Guidelines
Checklist
Fixes: https://tracker.ceph.com/issues/80267