Repository navigation
rgw/multisite: never distribute an uncommitted staging period - #72669
Open
lumir-sliva wants to merge 2 commits into
Open
lumir-sliva wants to merge 2 commits into
lumir-sliva wants to merge 2 commits into
Conversation
commit_period() in radosgw-admin notified the realm even when rgw::commit_period() failed. The period at that point still carries the staging id, so RGWPeriodPusher on every gateway pushed "<realm_id>:staging" to the other zones, which stored it as their current period. The real committed period arrives later with a lower epoch and gets discarded, the zone is stuck on the staging period and every following master change is refused. This started when the realm notify moved out of rgw::commit_period() in ab30392, which made it unconditional. A refused master change is enough to trigger it, for example "period update --commit" on a secondary without --yes-i-really-mean-it. Only notify after a successful commit, and refuse staging period ids in the period pusher and in POST /admin/realm/period, so a peer that still leaks one can't poison the other zones. Fixes: https://tracker.ceph.com/issues/81760 Signed-off-by: Lumir Sliva <[email protected]>
|
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 |
14 tasks
5 of 14 tasks
Contributor
|
looks good, thanks @lumir-sliva. please add a test case if you can. |
smanjara
approved these changes
Nov 4, 2026
Two tests for the fix of #81760. A failed 'period commit' on the master zone must not reach the other zones: 'period update --commit' leaves the staging period one epoch behind, so committing it again is refused, and before the fix the period pusher still sent "<realm_id>:staging" to every zone, which made it current. And a zone must refuse a staging period pushed to POST /admin/realm/period, as an older gateway's period pusher would send it. Fixes: https://tracker.ceph.com/issues/81760 Signed-off-by: Lumir Sliva <[email protected]>
Contributor
Author
thanks, tests added. |
Contributor
|
This PR has been added to wip-anrao6-testing-2026-11-13-0833-main. |
Contributor
|
This PR has been removed from wip-anrao6-testing-2026-11-13-1158-main. |
Contributor
|
This PR has been added to wip-anrao1-testing-2026-11-26-0609-main. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A failed
period update --commiton the master zone still notified the realm. At that point the period carries the staging id<realm_id>:staging, so the period pusher sent it to every other zone, and they made it their current period. The real period that follows has a lower epoch and gets dropped, every later master change is refused, and in my tests both zones ended up master of their own copy (split brain).The notify became unconditional in ab30392 (#57640), when it moved out of
rgw::commit_period(). Squid isn't affected.The fix has three layers. Each one stops the leak on its own, so a zone that still leaks can't poison a zone with the fix:
commit_period()in radosgw-admin notifies only after a successful commitRGWPeriodPusher::handle_notify()refuses to push a staging idRGWOp_Period_Postrejects a pushed staging id with -EINVALTested on two tentacle 20.2.4 clusters (4 gateways per zone) with a genuine refusal: metadata sync stopped on zone B, master moved A -> B -> A, then promoting B without
--yes-i-really-mean-itwas refused with "2 period(s) behind". Each layer was switched on alone:The receiver check protects the peer's state but not period delivery. An old pusher that leaked a staging period has recorded its realm epoch, so it drops the real period from the next commit as "not newer" and keeps retrying the staging one (backoff capped at 30 s) until its gateway restarts or a later period comes along. In a mixed-version realm, the zone that runs
period update --commitneeds the new radosgw-admin or the new gateways. If a commit fails on a zone that hasn't been upgraded yet, restart that zone's gateways before retrying.A zone that already took the staging period as current doesn't recover by itself after the upgrade: the real period with the same realm epoch is refused as a fork in the period history. In my tests, running
radosgw-admin realm pull --url <master>on that zone, thenmetadata sync initand a gateway restart on both zones, got it back.The second commit adds two tests to
rgw_multi/tests.py:test_failed_period_commit_not_distributed:period update --commiton the master leaves the staging period one epoch behind, so a followingperiod commitis refused on the epoch check. The test checks that no zone switches to the staging period.test_staging_period_push_rejected: sends the master's staging period to a secondary's/admin/realm/periodthe way an older pusher does, and expects HTTP 400 with the secondary keeping its period.On a 3-zone mstart realm, 2 runs each: without the fix both fail (the second zone takes
<realm_id>:staging, and the push gets HTTP 200). With the fix both pass, the refused commit sends nothing, and the receiver logs "rejecting uncommitted staging period". The pusher check has no test of its own, because with the radosgw-admin fix in place nothing can trigger it.Built on current main (504b1a2,
radosgwandradosgw-admin). The lab runs were on a v20.2.4 backport of the same fix, and the test runs on a build carrying the same three files.Fixes: https://tracker.ceph.com/issues/81760
Backport: tentacle.
Checklist