Skip to content

tentacle: rgw: redirect to the endpoint of the bucket's zonegroup - #71522

Merged
batrick merged 2 commits into
ceph:tentaclefrom
RaminNietzsche:wip-80246-tentacle
Sep 30, 2026
Merged

batrick merged 2 commits into
ceph:tentaclefrom
RaminNietzsche:wip-80246-tentacle

Conversation

@RaminNietzsche

@RaminNietzsche RaminNietzsche commented Sep 3, 2026 •

Copy link
Copy Markdown
Member

Summary

Backport of #70931 to tentacle.

When a request for a bucket in another zonegroup reaches a gateway,
rgw_build_bucket_policies() returns ERR_PERMANENT_REDIRECT, but
s->zonegroup_endpoint was taken from the local zonegroup. The
Location header then pointed clients back at the same gateway, causing
redirect loops in multi-zonegroup deployments (tracker #64983).

Add rgw::find_zonegroup_by_id() and use the bucket's zonegroup endpoint
for 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

  • Includes unittest_rgw_zone (from main PR)
  • Not run locally on tentacle yet

Contribution Guidelines

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)

Fixes: https://tracker.ceph.com/issues/80265

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)
@RaminNietzsche
RaminNietzsche requested a review from a team as a code owner September 3, 2026 13:55
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

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 ci-approved to allow Jenkins CI jobs to run.

github-actions[bot]

This comment was marked as outdated.

@github-actions github-actions Bot added the releng-audit-fail Release engineering: failed backport verification audit. label Sep 3, 2026
@RaminNietzsche

Copy link
Copy Markdown
Member Author

@ceph/ceph-release-manager @adamemerson — sorry for the tracker linkage noise on this backport.

After a fix lands on main, I usually open stable backports myself with git cherry-pick -x from the merged commits. The cherry-picks here are clean and commit parity looks correct; the Backport Audit failure is on the Redmine side, not the code.

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.

@adamemerson adamemerson removed needs-ci-approval releng-audit-fail Release engineering: failed backport verification audit. labels Sep 3, 2026
github-actions[bot]

This comment was marked as outdated.

@github-actions github-actions Bot added the releng-audit-fail Release engineering: failed backport verification audit. label Sep 3, 2026
@github-actions github-actions Bot removed the releng-audit-fail Release engineering: failed backport verification audit. label Sep 6, 2026
github-actions[bot]

This comment was marked as outdated.

@github-actions github-actions Bot added the releng-audit-fail Release engineering: failed backport verification audit. label Sep 6, 2026
@anrao19

anrao19 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to tentacle integration testing by anuchaithra started 2026-09-10-10:17.

@anrao19

anrao19 commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

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
@RaminNietzsche, if no further testing is needed then this pr can be megred

@batrick batrick added the releng-audit-queue Release engineering: queued for backport verification audit. label Sep 30, 2026
@github-actions github-actions Bot removed the releng-audit-queue Release engineering: queued for backport verification audit. label Sep 30, 2026
@github-actions github-actions Bot added releng-audit-pass Release engineering: passed backport verification audit. and removed releng-audit-fail Release engineering: failed backport verification audit. labels Sep 30, 2026
@batrick batrick modified the milestones: tentacle, v20.2.5 Sep 30, 2026
@batrick
batrick merged commit dcb7828 into ceph:tentacle Sep 30, 2026
26 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants