Repository navigation
rgw/multisite: do not report metadata sync caught up on an old period - #72778
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
'radosgw-admin sync status' compared the period of the metadata sync with the zone's own current period and, when they differed, printed "master is on a different period" and skipped the shard comparison. With no shards to compare it then counted nothing as behind and printed "metadata is caught up with master" right below. When the zone's own period was stale too, because it missed the period push while its gateways were down, the two periods matched, the shards were compared against the master's mdlog of that old period, and the output said caught up with no hint at all. Ask the master for the realm's current period (GET /admin/realm over the master connection, falling back to the local period if the request fails) and compare the period and realm epoch of the sync against that. When they differ, print the period and realm epoch of the sync, of the local configuration if that one is stale as well, and of the master, report how many periods the metadata sync is behind, and never claim it is caught up. The shard comparison is unchanged and still only runs when the sync is on the local period, whose mdlog is the one fetched. Fixes: https://tracker.ceph.com/issues/81763 Signed-off-by: Lumir Sliva <[email protected]>
Stop the gateways of a non-master zone, move the master to another zone and check that 'radosgw-admin sync status' on the stopped zone reports its metadata sync as one period behind rather than caught up, both while the zone's own period is stale and after a 'realm pull' brought in the current period. Then restart the gateways, move the master back and check that the output says caught up again. Fixes: https://tracker.ceph.com/issues/81763 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 |
5 of 14 tasks
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.
Summary
radosgw-admin sync statusprints "metadata is caught up with master" for a zone whose metadata sync is still on an older period than the realm's current one, which is exactly the state an operator runs it for after a master change.Problem
get_md_sync_status()(src/rgw/radosgw-admin/radosgw-admin.cc) compares the sync's period with the zone's own current period, not the master's: the variable is calledmaster_period, but it holds the localget_current_period_id(). Both cases reproduce with three zones on one box, zone 3's gateway down while the master moves from zone 1 to zone 2:realm pullon zone 3 (gateway still down) the local period is the new one. The command prints "master is on a different period", skips the shard comparison, counts nothing as behind and prints "metadata is caught up with master" right below.Fix
Ask the master for the realm's current period (
GET /admin/realmover the master connection, the endpointrealm pulluses; the local period stays the fallback if the request fails) and compare the sync's period and realm epoch against it. When they differ, the output names the sync's period, the local one if that is stale as well, and the master's, says how many periods metadata sync is behind, and never says caught up. The shard comparison is unchanged and still only runs when the sync is on the local period, whose mdlog is the one fetched. The old "master is on a different period" line is replaced.Test
Case 1 before:
Case 1 after:
Case 2 prints the same without the "local period" line.
The second commit adds
test_sync_status_metadata_period_behind, covering both cases and checking that the output says caught up again once the zone is back (3 zones, 1 gateway each). On main it fails atassert 'metadata is caught up with master' not in status; with the fix it passes in 79 s.test_multi_period_incremental_syncfails on current main regardless of this change (zone 3 ends up on a period id the other zones don't have, https://tracker.ceph.com/issues/81758); with #72671 on top it passes with this change as well.Fixes: https://tracker.ceph.com/issues/81763
Checklist