Repository navigation
rgw: fix bilog autotrim of stale bucket.instance metadata after peer deletion - #70003
Conversation
|
I think the test always fails with the two-zonegroup configuration. |
and these are the ones failing currently with " |
Let me rerun them. |
@smanjara below are the re-run (of failed and dead jobs) results. all runs for this test branch provides the full list of runs: 3 original analyzed above and the top 3 are the re-runs of them. Original submissions were analyzed in description section above; below are the analysis of re-runs (in particular multisite with 2 zonegroup cfg). [1] rgw::multisite (two-zonegroup) -> https://pulpito.ceph.com/bcs-ceph-2026-07-07_20:17:08-rgw:multisite-wip-oozmen-trim-after-reshard-distro-default-trial/: All 4 'bucket_trim' tests passed...Only 1 test failed which is being addressed in another PR. [2] rgw::multisite (two-zonegroup) -> https://pulpito.ceph.com/bcs-ceph-2026-07-07_19:50:19-rgw:multisite-wip-oozmen-trim-after-reshard-distro-default-trial/: All 4 'bucket_trim' tests passed...Only 1 test failed which is being addressed in another PR. [3] rgw (all suites) -> https://pulpito.ceph.com/bcs-ceph-2026-07-07_20:17:46-rgw-wip-oozmen-trim-after-reshard-distro-default-trial/; multisite job (two-zonegroup) passed all tests: no failures To sum up, looking at all 6 submissions multisite runs, things look good:
If you are OK with the changes, I'll do one last full rgw suites QA run. Please have a look. |
57d610d to
8ed59ca
Compare
8ed59ca to
41e0511
Compare
…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]>
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]>
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]>
…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]>
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]>
41e0511 to
80f203e
Compare
|
ceph-ci branch: https://github.com/ceph/ceph-ci/tree/wip-oozmen-trim-reshard-testing-2026-07-17-1429
All testsutes passed except for
Specifically, both multisite suites (2-zone and 2-zonegroup) passed all tests including all 6 bucket_trim tests: |

Fixes https://tracker.ceph.com/issues/70858
Summary
Bilog autotrim can permanently leave orphaned bucket.instance metadata after a bucket is deleted. When a peer zone reports -ENOENT for a bucket's sync status, the code only treated it as "peer is done with this bucket" if the local zone had already received the Deleted flag via metadata sync; however, that flag can never arrive if the source zone's own autotrim already removed its instance metadata first, since metadata-sync removal is a no-op by design. This fix trusts a peer's -ENOENT unconditionally and directly removes orphaned instance metadata once all peers confirm the bucket is gone, closing the race.
Preliminary QA Testing
Just wanted to see how it works on teuthology, submitted a couple of multisite jobs. Due to some lab issues (due to storm I think) some jobs were dead saying "["Wanted 2 disks of ~1700 GB (rotational=False), but only matched 1: ['nvme0n1']"]" but got a good preliminary when/if this is approved, I'll send this for a final QA test.
Test branch that has this changeset: https://github.com/ceph/ceph-ci/tree/wip-oozmen-trim-after-reshard
QA multisite runs:
[1] rgw:multisite run https://pulpito.ceph.com/bcs-ceph-2026-07-05_11:36:33-rgw:multisite-wip-oozmen-trim-after-reshard-distro-default-trial/
[2] rgw:multisite run https://pulpito.ceph.com/bcs-ceph-2026-07-05_11:36:17-rgw:multisite-wip-oozmen-trim-after-reshard-distro-default-trial/
[3] rgw run https://pulpito.ceph.com/bcs-ceph-2026-07-05_11:34:14-rgw-wip-oozmen-trim-after-reshard-distro-default-trial/
So, 4 rgw:multisite runs passed the 'bucket_trim' tests.
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.