Skip to content

umbrella: rgw: fix bilog autotrim of stale bucket.instance metadata after peer deletion - #70454

Merged
batrick merged 5 commits into
ceph:umbrellafrom
BBoozmen:wip-78581-umbrella
Aug 3, 2026
Merged

batrick merged 5 commits into
ceph:umbrellafrom
BBoozmen:wip-78581-umbrella

Conversation

@BBoozmen

Copy link
Copy Markdown
Contributor

BBoozmen added 5 commits July 22, 2026 16:42
…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)
@BBoozmen
BBoozmen requested a review from a team as a code owner July 22, 2026 16:43
@BBoozmen BBoozmen added this to the umbrella milestone Jul 22, 2026
@BBoozmen BBoozmen added the rgw label Jul 22, 2026
@github-actions github-actions Bot added tests releng-audit-pass Release engineering: passed backport verification audit. labels Jul 22, 2026
@batrick batrick modified the milestones: umbrella, v21.1.1 Jul 28, 2026
@batrick
batrick merged commit 95c8a0e into ceph:umbrella Aug 3, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-qa releng-audit-pass Release engineering: passed backport verification audit. rgw tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants