Repository navigation
umbrella: rgw: fix bilog autotrim of stale bucket.instance metadata after peer deletion - #70454
Merged
Merged
Conversation
…ary reshard Adds test_bucket_log_trim_enoent_race_after_reshard to reproduce the exact failure from tracker ceph#70858: when autotrim runs on the primary zone first and fully cleans up (including removing its own bucket.instance metadata), then an autotrim on the secondary zone asks the primary and receives -ENOENT. The secondary hasn't received the BucketLogType::Deleted flag yet (metadata sync is stalled via delay injection), so the current code left StatusShards{generation=0, shards=[]} which caused take_min_status() to fail with -EINVAL, leaving the bucket.instance metadata permanently orphaned. Tests: https://tracker.ceph.com/issues/70858 Signed-off-by: Oguzhan Ozmen <[email protected]> (cherry picked from commit 43518e2)
An all-peer -ENOENT does not by itself mean a bucket is deleted: a live bucket whose sync status is not yet initialized returns -ENOENT too. Add two testcases that verifies we do not accidentally delete instance of a live bucket: - test_bucket_log_trim_live_empty_bucket_not_removed: a data-less bucket never gets sync status, so every peer reports -ENOENT; autotrim must not remove its instance. - test_bucket_log_trim_new_bucket_entrypoint_not_synced: a new bucket whose instance has synced to the secondary before its entrypoint must survive autotrim. A delay_meta_sync_bucket_entrypoint_store injection forces that window. Tests: https://tracker.ceph.com/issues/70858 Signed-off-by: Oguzhan Ozmen <[email protected]> (cherry picked from commit 6cc8ee2)
When a peer returns -ENOENT for a bucket's sync status, the old code only purged the log if the local layout already carried BucketLogType::Deleted. That flag may never arrive once the deleting zone removes its own instance (ceph#70858), so trim aborted with -EINVAL and left bucket.instance metadata orphaned. But an all-peer -ENOENT is also ambiguous: a live bucket whose sync status is not yet initialized looks the same. The Deleted flag is unreliable here, and the local entrypoint is not authoritative during creation (the instance syncs to peers before the entrypoint). So on all-peer -ENOENT, confirm the bucket is really gone by reading its entrypoint from the metadata master, which is authoritative and available immediately on creation; if this zone is the metadata master its local read already suffices. Only on confirmed deletion remove the orphaned instance directly; on any failure, skip and retry on the next trim cycle. Fixes: https://tracker.ceph.com/issues/70858 Signed-off-by: Oguzhan Ozmen <[email protected]> (cherry picked from commit 35135ce)
…s shards CR The peer -ENOENT handling in RGWReadRemoteStatusShardsCR no longer consults the local bucket layout (whether Deleted flag set or not), so its bucket_info member and the matching constructor arg are not used anymore. Signed-off-by: Oguzhan Ozmen <[email protected]> (cherry picked from commit 90f7bff)
Raise a few low-frequency, high-signal bilog trim events so they are visible at the default log level: Trim pace is bounded by the rgw trim config options and these events fire at most once per bucket or once per trim cycle, so they are not expected to be chatty. Signed-off-by: Oguzhan Ozmen <[email protected]> (cherry picked from commit 80f203e)
adamemerson
approved these changes
Jul 28, 2026
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.
backport tracker: https://tracker.ceph.com/issues/78581
backport of #70003
parent tracker: https://tracker.ceph.com/issues/70858
this backport was staged using ceph-backport.sh version 16.0.0.6848
find the latest version at https://github.com/ceph/ceph/blob/main/src/script/ceph-backport.sh