Skip to content

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

Merged
batrick merged 7 commits into
ceph:tentaclefrom
BBoozmen:wip-78582-tentacle
Sep 1, 2026
Merged

batrick merged 7 commits into
ceph:tentaclefrom
BBoozmen:wip-78582-tentacle

Conversation

@BBoozmen

Copy link
Copy Markdown
Contributor

BBoozmen added 5 commits July 22, 2026 16:45
…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:45
@BBoozmen BBoozmen added this to the tentacle 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
@anrao19

anrao19 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

@adamemerson

Copy link
Copy Markdown
Contributor

@anrao19

anrao19 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

This PR has been removed from wip-anuchaithra-testing-20260729.084156-tentacle.

@anrao19

anrao19 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

test_bucket_log_trim_after_delete_bucket_secondary_reshard is meant to
reshard the bucket on the *secondary* zone, then delete it on the primary
and verify bilog autotrim cleans up the stale bucket.instance metadata.
But the reshard command was issued without zone arguments, so
radosgw-admin fell back to the default zone of the client it ran on (the
primary). The bucket was therefore resharded on the primary, not the
secondary, so the test never exercised the cross-zone generation mismatch
that the trim fix handles.

Append secondary.zone.zone_args() so the reshard explicitly targets the
secondary zone.

This is the single relevant hunk of upstream commit
3ae0007 (PR ceph#67661, tracker
https://tracker.ceph.com/issues/75340). The remainder of that commit
adjusts test_versioned_bucket_sync_disable_enable_object_delete, which
does not exist on this branch, so only this hunk is taken.

Signed-off-by: Oguzhan Ozmen <[email protected]>
@github-actions github-actions Bot removed the releng-audit-pass Release engineering: passed backport verification audit. label Aug 9, 2026
@BBoozmen

BBoozmen commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Removing from the current run due to a failure in test_bucket_log_trim_new_bucket_entrypoint_not_synced in run https://pulpito.ceph.com/anuchaithra-2026-07-29_17:17:23-rgw-wip-anuchaithra-testing-20260729.084156-tentacle-distro-default-trial/409624/

@adamemerson thanks for pulling this from the run.

Both failures are test-harness gaps on tentacle, not issues with the backported fix. I've addressed both with test-only (tests.py) commits:

1) test_bucket_log_trim_new_bucket_entrypoint_not_synced: NameError: name 'override_config' is not defined

2026-07-29T18:38:40.083 INFO:tasks.rgw_multisite_tests:======================================================================
2026-07-29T18:38:40.083 INFO:tasks.rgw_multisite_tests:ERROR: rgw_multi.tests.test_bucket_log_trim_new_bucket_entrypoint_not_synced
2026-07-29T18:38:40.083 INFO:tasks.rgw_multisite_tests:----------------------------------------------------------------------
2026-07-29T18:38:40.084 INFO:tasks.rgw_multisite_tests:Traceback (most recent call last):
2026-07-29T18:38:40.084 INFO:tasks.rgw_multisite_tests:  File "/home/teuthworker/src/git.ceph.com_teuthology_1fcba62fdc66bf66c0e46aa34af7211788698d08/.venv/lib/python3.12/site-packages/nose/case.py", line 171, in runTest
2026-07-29T18:38:40.084 INFO:tasks.rgw_multisite_tests:    self.test(*self.arg)
2026-07-29T18:38:40.084 INFO:tasks.rgw_multisite_tests:  File "/home/teuthworker/src/github.com_ceph_ceph-ci_0212d03851e59e33f18a8aaefc9a317d465ee5b3/qa/../src/test/rgw/rgw_multi/tests.py", line 2196, in test_bucket_log_trim_ne
w_bucket_entrypoint_not_synced
2026-07-29T18:38:40.084 INFO:tasks.rgw_multisite_tests:    with override_config(checkpoint_retries=30, checkpoint_delay=2):
2026-07-29T18:38:40.084 INFO:tasks.rgw_multisite_tests:         ^^^^^^^^^^^^^^^
2026-07-29T18:38:40.084 INFO:tasks.rgw_multisite_tests:NameError: name 'override_config' is not defined

override_config was introduced on main by #67798, which per its parent tracker (#75466 note-11) was not meant to be backported to tentacle. I've cherry-picked just the commit that adds the helper — d0c466c ("rgw/test/multisite: add a mechanism to use custom config temporarily") — which clears this error.

2) test_bucket_log_trim_after_delete_bucket_secondary_reshard — AssertionError (2-zonegroup suite)

I also noticed a relevant testcase failure (one of the 2 suites):

2026-07-29T18:38:40.085 INFO:tasks.rgw_multisite_tests:======================================================================
2026-07-29T18:38:40.085 INFO:tasks.rgw_multisite_tests:FAIL: rgw_multi.tests.test_bucket_log_trim_after_delete_bucket_secondary_reshard
2026-07-29T18:38:40.085 INFO:tasks.rgw_multisite_tests:----------------------------------------------------------------------
2026-07-29T18:38:40.085 INFO:tasks.rgw_multisite_tests:Traceback (most recent call last):
2026-07-29T18:38:40.085 INFO:tasks.rgw_multisite_tests:  File "/home/teuthworker/src/git.ceph.com_teuthology_1fcba62fdc66bf66c0e46aa34af7211788698d08/.venv/lib/python3.12/site-packages/nose/case.py", line 171, in runTest
2026-07-29T18:38:40.086 INFO:tasks.rgw_multisite_tests:    self.test(*self.arg)
2026-07-29T18:38:40.086 INFO:tasks.rgw_multisite_tests:  File "/home/teuthworker/src/github.com_ceph_ceph-ci_0212d03851e59e33f18a8aaefc9a317d465ee5b3/qa/../src/test/rgw/rgw_multi/tests.py", line 2024, in test_bucket_log_trim_af
ter_delete_bucket_secondary_reshard
2026-07-29T18:38:40.086 INFO:tasks.rgw_multisite_tests:    assert check_bucket_instance_metadata(zone.zone, test_bucket.name)
2026-07-29T18:38:40.086 INFO:tasks.rgw_multisite_tests:           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-07-29T18:38:40.086 INFO:tasks.rgw_multisite_tests:AssertionError

The backported fix here is unchanged and correct; this is a second missing test-only change. On tentacle the test's reshard call omits the zone args, so radosgw-admin runs against the default zone (the primary) rather than the secondary; the test never actually sets up the secondary-reshard scenario the fix is meant to exercise. On main that reshard line carries secondary.zone.zone_args(), added by an unrelated commit (3ae00074d90, #67661 / #75340) that was never backported. That commit doesn't cherry-pick cleanly here (the rest of it edits test_versioned_bucket_sync_disable_enable_object_delete, which doesn't exist on tentacle), so I've backported only the single relevant hunk.

Net: two small test-only commits added on top of this PR; the backported fix itself is untouched.

@anrao19

This PR has been added to tentacle integration testing by anuchaithra started 2026-08-05-06:31.

Unfortunately, you'll need to re-create a new ceph-ci test branch. You'll need to spin a fresh ceph-ci test branch/build to pick up the two commits I just pushed to this backport PR:

  • c252c29aa35 rgw/test/multisite: add a mechanism to use custom config temporarily
  • 84182b6d17b rgw/test/multisite: reshard the secondary zone in bilog-trim delete test

github-actions[bot]

This comment was marked as outdated.

@github-actions github-actions Bot added the releng-audit-fail Release engineering: failed backport verification audit. label Aug 9, 2026
@adamemerson

Copy link
Copy Markdown
Contributor

/audit override

@adamemerson adamemerson reopened this Aug 10, 2026
@github-actions github-actions Bot added releng-audit-override and removed releng-audit-fail Release engineering: failed backport verification audit. labels Aug 10, 2026
@github-actions

Copy link
Copy Markdown

✅ Audit Override Applied by @adamemerson.

View workflow run

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ceph Release Engineering Audit Report

Automated Redmine Linkage Audit

The following tracking irregularities were found:

  • Rejected Backport Ticket: Backport tracker #75638 is marked as Rejected. Perhaps this backport PR should be closed?
  • Missing PR Link: Backport tracker #75638 has no 'Pull Request ID' field set. Please link it to PR #70456.

Automated Backport Parity Review - Invalid Commit Format

The following commits have an invalid format. Backport commits must either include a standard (cherry picked from commit ...) line or start with the target branch name (e.g., tentacle:).

  • 84182b6d rgw/test/multisite: reshard the secondary zone in bilog-trim delete test

Be familiar with the rules and guidelines for writing backports.


Automated Backport Parity Review

⚠️ Multiple Original PRs Detected: PR #67798, PR #70003

Discrepancies detected between the backport PR and the original source PR(s). Please see the Commit Parity Visualizer below.


Commit Parity Visualizer

BACKPORT PR #70456 SOURCE PR SOURCE STATUS
c252c29 rgw/test/multisite: add a mechanism to use custom config temporarily PR #67798 d0c466c rgw/test/multisite: add a mechanism to use custom config temporarily
<<<< MISSING IN BACKPORT >>>> d8a6489 rgw/test/multisite: use config's retry settings
<<<< MISSING IN BACKPORT >>>> 95465d6 rgw/test/multisite: test_period_update_commit use a custom retry setting
<<<< MISSING IN BACKPORT >>>> 2a83b3e rgw/test/multisite: run sync status on the intended zone
<<<< MISSING IN BACKPORT >>>> ba2dc12 rgw/test/multisite: get_oldest_incremental_change_not_applied_epoch - handle sync-status failure gracefully
<<<< MISSING IN BACKPORT >>>> 60666a2 rgw/test/multisite: revise test_period_update_commit testcase client wkld settings
<<<< MISSING IN BACKPORT >>>> 735490b rgw/test/multisite: revise test_period_update_commit zone selection for clarity
<<<< MISSING IN BACKPORT >>>> a42cf8e rgw/pubsub: fix uninitialized num_shards causing topic deletion hang
0fc59fb rgw/test/multisite: test for bilog autotrim -ENOENT race after secondary reshard PR #70003 43518e2 rgw/test/multisite: test for bilog autotrim -ENOENT race after secondary reshard
c72593b rgw/test/multisite: tests for bilog autotrim -ENOENT interpretation 6cc8ee2 rgw/test/multisite: tests for bilog autotrim -ENOENT interpretation
3c6d0d5 rgw/bilog/trim: fix stale bucket.instance metadata after peer deletion 35135ce rgw/bilog/trim: fix stale bucket.instance metadata after peer deletion
5dd425b rgw/bilog/trim: (non-functional) remove unused bucket_info from status shards CR 90f7bff rgw/bilog/trim: (non-functional) remove unused bucket_info from status shards CR
21af17c rgw/bilog/trim: (non-functional) set some bilog trim events to level 1 80f203e rgw/bilog/trim: (non-functional) set some bilog trim events to level 1
84182b6 rgw/test/multisite: reshard the secondary zone in bilog-trim delete test <<<< EXTRA IN BACKPORT >>>>

🛟 Need Help?

If you need technical help resolving these issues, please consult with the Component Lead. If you need administrative overrides, please see the #ceph-upstream-releases channel on Slack and request a review from the @ceph/ceph-release-manager.

📋 Component Lead / Release Manager

To override the audit failure, apply releng-audit-override label or comment /audit override.


⚠️ Note: Automated audit checks will be suspended on future pushes to prevent comment spam while you work.

When you are ready for a new audit, please remove the releng-audit-fail label or comment /audit retest.

View workflow run

@github-actions github-actions Bot added the releng-audit-fail Release engineering: failed backport verification audit. label Aug 10, 2026
@adamemerson

Copy link
Copy Markdown
Contributor

/audit override

@github-actions github-actions Bot added releng-audit-override and removed releng-audit-fail Release engineering: failed backport verification audit. labels Aug 10, 2026
@github-actions

Copy link
Copy Markdown

✅ Audit Override Applied by @adamemerson.

View workflow run

@anrao19

anrao19 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to tentacle integration testing by anuchaithra started 2026-08-05-06:31.

pr testing completed with new build and approved by @ivancich , more details : https://tracker.ceph.com/issues/79051
@BBoozmen, if no further testing is needed then this pr can be merged

@BBoozmen

BBoozmen commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor Author

This PR has been added to tentacle integration testing by anuchaithra started 2026-08-05-06:31.

pr testing completed with new build and approved by @ivancich , more details : https://tracker.ceph.com/issues/79051
@BBoozmen, if no further testing is needed then this pr can be merged

Thank you @anrao19 . Unfortunately, you'll need to run the multisite test again after creating an new ceph-ci test-branch. The current test-branch wip-anuchaithra-testing-20260805.063130-tentacle doesn't include the 2 commits I added on Aug 08 (please see above comment for details). Since it doesn't include these 2 new commits, we still get the below error in this run:

2026-08-07T07:05:15.457 INFO:tasks.rgw_multisite_tests:======================================================================
2026-08-07T07:05:15.458 INFO:tasks.rgw_multisite_tests:ERROR: rgw_multi.tests.test_bucket_log_trim_new_bucket_entrypoint_not_synced
2026-08-07T07:05:15.458 INFO:tasks.rgw_multisite_tests:----------------------------------------------------------------------
2026-08-07T07:05:15.458 INFO:tasks.rgw_multisite_tests:Traceback (most recent call last):
2026-08-07T07:05:15.458 INFO:tasks.rgw_multisite_tests:  File "/home/teuthworker/src/git.ceph.com_teuthology_1fcba62fdc66bf66c0e46aa34af7211788698d08/.venv/lib/python3.12/site-packages/nose/case.py", line 171, in runTest
2026-08-07T07:05:15.458 INFO:tasks.rgw_multisite_tests:    self.test(*self.arg)
2026-08-07T07:05:15.458 INFO:tasks.rgw_multisite_tests:  File "/home/teuthworker/src/github.com_ceph_ceph-ci_03eba57da849af64b9c5d97f429ee3f2c2e5b20c/qa/../src/test/rgw/rgw_multi/tests.py", line 2196, in test_bucket_log_trim_ne
w_bucket_entrypoint_not_synced
2026-08-07T07:05:15.458 INFO:tasks.rgw_multisite_tests:    with override_config(checkpoint_retries=30, checkpoint_delay=2):
2026-08-07T07:05:15.458 INFO:tasks.rgw_multisite_tests:         ^^^^^^^^^^^^^^^
2026-08-07T07:05:15.458 INFO:tasks.rgw_multisite_tests:NameError: name 'override_config' is not defined

@anrao19 - If you don't mind, can you please create a new test-branch to get the latest state of this PR. I'll mark this "needs-qa" again as a result. Perhaps, you can include this PR in another QA Run tracker to unblock other PRs also included in https://tracker.ceph.com/issues/79051 or re-do the this tracker again.

@yuriw

yuriw commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to wip-yuri14-testing-20260812.153525-tentacle.

@BBoozmen

Copy link
Copy Markdown
Contributor Author

wip-yuri14-testing-20260812.153525-tentacle

@yuriw just looked at your rgw run for this branch: https://pulpito.ceph.com/yuriw-2026-08-12_19:24:08-rgw-wip-yuri14-testing-20260812.153525-tentacle-distro-default-trial/: the results look good. In both multisite sites (2-zone and 2-zonegroup), all the related 6 testcases passed:

2026-08-12T23:01:24.868 INFO:tasks.rgw_multisite_tests:rgw_multi.tests.test_bucket_index_log_trim ... ok
2026-08-12T23:02:15.771 INFO:tasks.rgw_multisite_tests:rgw_multi.tests.test_bucket_log_trim_after_delete_bucket_primary_reshard ... ok
2026-08-12T23:03:12.079 INFO:tasks.rgw_multisite_tests:rgw_multi.tests.test_bucket_log_trim_after_delete_bucket_secondary_reshard ... ok
2026-08-12T23:04:36.374 INFO:tasks.rgw_multisite_tests:rgw_multi.tests.test_bucket_log_trim_enoent_race_after_reshard ... ok
2026-08-12T23:05:02.003 INFO:tasks.rgw_multisite_tests:rgw_multi.tests.test_bucket_log_trim_live_empty_bucket_not_removed ... ok
2026-08-12T23:06:12.908 INFO:tasks.rgw_multisite_tests:rgw_multi.tests.test_bucket_log_trim_new_bucket_entrypoint_not_synced ... ok

A couple of testcases failed are not relevant to this PR; we can mark this one TESTED.

@batrick batrick left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

is not optional. Please fix it.

84182b6 could have been a legit cherry-pick with extraneous hunks dropped (with explanation).

@adamemerson

Copy link
Copy Markdown
Contributor

@BBoozmen Can you please do Patrick's stuff?

@BBoozmen

BBoozmen commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor Author

@adamemerson / @batrick - looking at the requested changes comment above, it refers to https://tracker.ceph.com/issues/75638 but it's a totally different tracker.

This PR's

I think there might be a mixup?

84182b6 could have been a legit cherry-pick with extraneous hunks dropped (with explanation).

An earlier comment above explains why we needed to cherry-pick two commits from two different PRs that weren't backported to Tentacle.

BTW, as noted in the other comment above, I verified that the related testcases passed in @yuriw 's QA test so I'll mark this TESTED.

@BBoozmen BBoozmen added TESTED and removed needs-qa labels Aug 28, 2026
@Naveenaidu

Copy link
Copy Markdown
Contributor

@batrick

batrick commented Sep 1, 2026

Copy link
Copy Markdown
Member

@adamemerson / @batrick - looking at the requested changes comment above, it refers to https://tracker.ceph.com/issues/75638 but it's a totally different tracker.

This PR's

* parent tracker is https://tracker.ceph.com/issues/70858

* and tentacle backport tracker is https://tracker.ceph.com/issues/78582

I think there might be a mixup?

84182b6 could have been a legit cherry-pick with extraneous hunks dropped (with explanation).

An earlier comment above explains why we needed to cherry-pick two commits from two different PRs that weren't backported to Tentacle.

BTW, as noted in the other comment above, I verified that the related testcases passed in @yuriw 's QA test so I'll mark this TESTED.

Thanks for explaining. This looks good to me.

@batrick
batrick dismissed their stale review September 1, 2026 16:33

addressed

@batrick batrick modified the milestones: tentacle, v20.2.5 Sep 1, 2026
@batrick
batrick merged commit 5b2abb7 into ceph:tentacle Sep 1, 2026
22 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants