Skip to content

rgw: break the coupling of olh epoch and epochs of olh ops - #67661

Merged
smanjara merged 7 commits into
ceph:mainfrom
jzhu116-bloomberg:wip-75340
Apr 13, 2026
Merged

smanjara merged 7 commits into
ceph:mainfrom
jzhu116-bloomberg:wip-75340

Conversation

@jzhu116-bloomberg

@jzhu116-bloomberg jzhu116-bloomberg commented Mar 4, 2026 •

Copy link
Copy Markdown
Contributor
  • the olh epoch is always in sync with the versioned_epoch of the instance that the olh points to
  • the epochs of olh ops are ever-increasing, even for the olh ops coming from the remote zones in multisite settings

This PR solves two issues:

  • a version instance failed to be promoted to current
  • leaking olh head objects and user.rgw.olh.pending.* attributes associated with the olh objects

Fixes: https://tracker.ceph.com/issues/75340
Signed-off-by: Jane Zhu [email protected]

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 x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@jzhu116-bloomberg
jzhu116-bloomberg requested a review from a team as a code owner March 4, 2026 23:46
@jzhu116-bloomberg

Copy link
Copy Markdown
Contributor Author

@cbodley can you please take a look at this as well? @igomon-bloomberg took a look and agreed with the fix

@jzhu116-bloomberg

Copy link
Copy Markdown
Contributor Author

more edge cases need to be handled. working on it now

@jzhu116-bloomberg jzhu116-bloomberg changed the title rgw: set proper epoch in the olh entry when unlinking an object version instance rgw: break the coupling of olh epoch and epochs of olh ops Mar 19, 2026
@jzhu116-bloomberg

Copy link
Copy Markdown
Contributor Author

This should also fix the issue described in https://tracker.ceph.com/issues/74428

@jzhu116-bloomberg

Copy link
Copy Markdown
Contributor Author

the PR is ready for review now

Comment thread src/rgw/driver/rados/rgw_rados.cc Resolved

@cbodley cbodley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks great, thanks

Comment thread src/test/rgw/rgw_multi/tests.py Outdated
Comment on lines +1764 to +1766
# Delete all object versions
cmd = ['object', 'rm', '--bucket', bucket.name, '--object', obj, '--object-version', version_id_1]
secondary.zone.cluster.admin(cmd)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

still curious about why s3 DeleteObject behaves differently than lifecycle and radosgw-admin

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

still curious about why s3 DeleteObject behaves differently than lifecycle and radosgw-admin

I'm curious too. In my todo list to test more and figure it out. Will come back to this soon

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I was not able to get the exact same test results with my earlier one. Might be because I had some local changes that I didn't notice.

However I did notice something interesting regarding the difference between s3 DeleteObject and radosgw-admin object rm when multisite replication is involved.

Testing steps:

  • spawn a pairs of mstart clusters
  • create a versioned bucket, and uploaded a few versions of an object
  • disable the bucket sync
  • on the secondary zone,
    (1) delete a version using s3 DeleteObject
    or
    (2) delete a version using radosgw-admin object rm, or lc process
  • enable the bucket sync
  • do a radosgw-admin bucket list on the secondary zone, we can see
    (1) if the delete is done using s3 request, the deleted object version is not re-synced back from the primary,
    (2) if the delete is done using radosgw-admin object rm or lc process, the object version is re-synced.

The culprit is obj_tombstone_cache. obj_tombstone_cache is in memory per rgw instance. The radosgw-admin has a different rados store instance hence its obj_tombstone_cache is not visible in the rgw instances.

It might be ok that s3 delete and radosgw-admin delete have a slight different behavior, but the same different behavior could happen when only rgw instances involved: the outcomes are different when the s3 DeleteObject and replication are handled by the same rgw instance, or handled by different rgw instances.

@cbodley cbodley Mar 23, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The culprit is obj_tombstone_cache. obj_tombstone_cache is in memory per rgw instance. The radosgw-admin has a different rados store instance hence its obj_tombstone_cache is not visible in the rgw instances.

oof, thanks :( that cache was a hack and we should probably remove it. let's think about a better model for that

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@cbodley

cbodley commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

This should also fix the issue described in https://tracker.ceph.com/issues/74428

thanks! i had written a test case in #67109 that reproduced that leak. would you be willing to pull that commit into this pr so we can validate that too?

@jzhu116-bloomberg

Copy link
Copy Markdown
Contributor Author

This should also fix the issue described in https://tracker.ceph.com/issues/74428

thanks! i had written a test case in #67109 that reproduced that leak. would you be willing to pull that commit into this pr so we can validate that too?

sure will do

@jzhu116-bloomberg

Copy link
Copy Markdown
Contributor Author

This should also fix the issue described in https://tracker.ceph.com/issues/74428

thanks! i had written a test case in #67109 that reproduced that leak. would you be willing to pull that commit into this pr so we can validate that too?

done

@jzhu116-bloomberg

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@jzhu116-bloomberg

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@jzhu116-bloomberg

Copy link
Copy Markdown
Contributor Author

enkins test make check

@jzhu116-bloomberg

Copy link
Copy Markdown
Contributor Author

@jzhu116-bloomberg

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@smanjara

smanjara commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

@jzhu116-bloomberg, looking at the test results from 119253, the tests and test_versioned_bucket_sync_disable_enable_object_delete and test_versioned_lifecycle_deletes are both failing. on 119288, just test_versioned_lifecycle_deletes fails.

2026-03-24T19:40:00.437 INFO:tasks.rgw_multisite_tests:FAIL: rgw_multi.tests.test_versioned_lifecycle_deletes
2026-03-24T19:40:00.437 INFO:tasks.rgw_multisite_tests:----------------------------------------------------------------------
2026-03-24T19:40:00.437 INFO:tasks.rgw_multisite_tests:Traceback (most recent call last):
2026-03-24T19:40:00.437 INFO:tasks.rgw_multisite_tests: File "/home/teuthworker/src/git.ceph.com_teuthology_c5deb799f72d19919e24da00a297c31b33741ccf/virtualenv/lib/python3.12/site-packages/nose/case.py", line 170, in runTest
2026-03-24T19:40:00.437 INFO:tasks.rgw_multisite_tests: self.test(*self.arg)
2026-03-24T19:40:00.437 INFO:tasks.rgw_multisite_tests: File "/home/teuthworker/src/git.ceph.com_ceph-c_12433c713c2d58b163a3307e574fed79b2daf5ba/qa/../src/test/rgw/rgw_multi/tests.py", line 4453, in test_versioned_lifecycle_deletes
2026-03-24T19:40:00.437 INFO:tasks.rgw_multisite_tests: assert len(olh) == 0
2026-03-24T19:40:00.437 INFO:tasks.rgw_multisite_tests: ^^^^^^^^^^^^^
2026-03-24T19:40:00.437 INFO:tasks.rgw_multisite_tests:AssertionError

@jzhu116-bloomberg

Copy link
Copy Markdown
Contributor Author

@jzhu116-bloomberg, looking at the test results from 119253, the tests and test_versioned_bucket_sync_disable_enable_object_delete and test_versioned_lifecycle_deletes are both failing. on 119288, just test_versioned_lifecycle_deletes fails.

yup, checking on them

jzhu116-bloomberg and others added 5 commits April 4, 2026 17:02
…the epochs of olh ops ever-increasing

Signed-off-by: Jane Zhu <[email protected]>
use the 'bucket check olh/unlinked' commands to test that all index
entries are cleaned up after all versions are deleted by lifecycle

Fixes: https://tracker.ceph.com/issues/74594

Signed-off-by: Casey Bodley <[email protected]>
…d make the epochs of olh ops ever-increasing

add an olh op log for a missed success scenario in olh handling

Signed-off-by: Jane Zhu <[email protected]>
do one bucket metadata update at a time to avoid a concurrent op failure

Signed-off-by: Jane Zhu <[email protected]>
@jzhu116-bloomberg

jzhu116-bloomberg commented Apr 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Missed one scenario where we need to fill in a CLS_RGW_OLH_OP_STALE to the op log.
It's been fixed in this commit.

@jzhu116-bloomberg

jzhu116-bloomberg commented Apr 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Here is my latest Teuthology run:
b438348

The 2 tests cases (test_versioned_bucket_sync_disable_enable_object_delete and test_versioned_lifecycle_deletes) failed in one of the multisite tests, and succeeded in the other.

I compared the success one and the failed one, and found something strange.

The Failed one:

https://qa-proxy.ceph.com/teuthology/bcs-ceph-2026-04-05_15:22:17-rgw-wip-bbjzhu116-testing-2026-04-04-1804-distro-default-trial/132773/teuthology.log
Test: test_versioned_bucket_sync_disable_enable_object_delete <-- FAIL

2026-04-05T15:59:16.441 INFO:tasks.util.rgw:rgwadmin: c1.client.0 : ['object', 'rm', '--bucket', 'cjxsoi-55', '--object', 'obj', '--object-version', 'xIkKJID.gwu-IIVS6oZerrbFGqvt6QA', '--cluster', 'c1', '--debug-rgw', '0', '--debug-ms', '0']  
<-- ** this is supposed to be done on cluster c2

Test: test_versioned_lifecycle_deletes <-- FAIL

2026-04-05T16:16:37.453 INFO:tasks.util.rgw:rgwadmin: c1.client.0 : ['lc', 'process', '--bucket', 'cjxsoi-79', '--rgw-lc-debug-interval=1', '--cluster', 'c1', '--debug-rgw', '0', '--debug-ms', '0']
2026-04-05T16:16:38.904 INFO:tasks.util.rgw:rgwadmin: c1.client.0 : ['lc', 'process', '--bucket', 'cjxsoi-79', '--rgw-lc-debug-interval=1', '--cluster', 'c1', '--debug-rgw', '0', '--debug-ms', '0']

2026-04-05T16:16:39.316 INFO:tasks.util.rgw:rgwadmin: c1.client.0 : ['lc', 'process', '--bucket', 'cjxsoi-80', '--rgw-lc-debug-interval=1', '--cluster', 'c1', '--debug-rgw', '0', '--debug-ms', '0']
  <-- ** this is supposed to be done on cluster c2

The success one:

https://qa-proxy.ceph.com/teuthology/bcs-ceph-2026-04-05_15:22:17-rgw-wip-bbjzhu116-testing-2026-04-04-1804-distro-default-trial/132808/teuthology.log
Test: test_versioned_bucket_sync_disable_enable_object_delete <-- ok

2026-04-05T16:09:42.396 INFO:tasks.util.rgw:rgwadmin: c2.client.0 : ['object', 'rm', '--bucket', 'dhncck-45', '--object', 'obj', '--object-version', '7Ph61xTUdyGiEiSkejGENyhiqzLahmo', '--cluster', 'c2', '--debug-rgw', '0', '--debug-ms', '0']

Test: test_versioned_lifecycle_deletes <-- ok

2026-04-05T16:24:31.071 INFO:tasks.util.rgw:rgwadmin: c1.client.0 : ['lc', 'process', '--bucket', 'dhncck-66', '--rgw-lc-debug-interval=1', '--cluster', 'c1', '--debug-rgw', '0', '--debug-ms', '0']
2026-04-05T16:24:32.494 INFO:tasks.util.rgw:rgwadmin: c1.client.0 : ['lc', 'process', '--bucket', 'dhncck-66', '--rgw-lc-debug-interval=1', '--cluster', 'c1', '--debug-rgw', '0', '--debug-ms', '0']

026-04-05T16:24:32.900 INFO:tasks.util.rgw:rgwadmin: c2.client.0 : ['lc', 'process', '--bucket', 'dhncck-67', '--rgw-lc-debug-interval=1', '--cluster', 'c2', '--debug-rgw', '0', '--debug-ms', '0']
2026-04-05T16:24:34.301 INFO:tasks.util.rgw:rgwadmin: c2.client.0 : ['lc', 'process', '--bucket', 'dhncck-67', '--rgw-lc-debug-interval=1', '--cluster', 'c2', '--debug-rgw', '0', '--debug-ms', '0']

We can see in the failed one, the radosgw-admin commands that should be run against the cluster c2 was actually running against c1.

It happened to an existing test case test_bucket_log_trim_after_delete_bucket_secondary_reshard too.

2026-04-05T16:00:44.036 INFO:tasks.util.rgw:rgwadmin: c1.client.0 : ['bucket', 'reshard', '--bucket', 'cjxsoi-62', '--num-shards', '13', '--yes-i-really-mean-it', '--cluster', 'c1', '--debug-rgw', '0', '--debug-ms', '0']
<-- ** this is supposed to be done on cluster c2

2026-04-05T16:00:44.159 INFO:tasks.util.rgw:rgwadmin: c1.client.0 : ['object', 'rm', '--rgw-zone', 'a1', '--rgw-zonegroup', 'a', '--rgw-realm', 'test-realm', '--bucket', 'cjxsoi-62', '--object', 'a', '--cluster', 'c1', '--debug-rgw', '0', '--debug-ms', '0']

2026-04-05T16:00:50.417 INFO:tasks.util.rgw:rgwadmin: c1.client.0 : ['bilog', 'autotrim', '--rgw-sync-log-trim-max-buckets', '50', '--rgw-zone', 'a2', '--rgw-zonegroup', 'a', '--rgw-realm', 'test-realm', '--cluster', 'c1', '--debug-rgw', '20', '--debug-ms', '0']

I wonder if there is any known issues here?

@jzhu116-bloomberg

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@jzhu116-bloomberg

Copy link
Copy Markdown
Contributor Author

jenkins test api

@cbodley

cbodley commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

2026-04-05T15:59:16.441 INFO:tasks.util.rgw:rgwadmin: c1.client.0 : ['object', 'rm', '--bucket', 'cjxsoi-55', '--object', 'obj', '--object-version', 'xIkKJID.gwu-IIVS6oZerrbFGqvt6QA', '--cluster', 'c1', '--debug-rgw', '0', '--debug-ms', '0']
<-- ** this is supposed to be done on cluster c2

the teuthology.log corresponding to the realms/two-zonegroup configuration shows two zones a1 and a2 in zonegroup a, and two zones b1 and b2 in zonegroup b. zones a1 and a2 are hosted on cluster c1, while b1 and b2 are hosted on cluster c2

your test case is only using the primary zonegroup a, so everything it does is against cluster c1:

def test_versioned_bucket_sync_disable_enable_object_delete():
    zonegroup = realm.master_zonegroup()
    zonegroup_conns = ZonegroupConns(zonegroup)

so i think the radosgw-admin command's --cluster argument is correct, but is missing --rgw-zone and --rgw-zonegroup arguments to specify the correct zone. there's a zone.zone_args() that adds these arguments, try adding that to the cmd:

     # Delete the second object version
     cmd = ['object', 'rm', '--bucket', bucket.name, '--object', obj, '--object-version', version_id_2]
-    secondary.zone.cluster.admin(cmd)
+    secondary.zone.cluster.admin(cmd + secondary.zone.zone_args())

@jzhu116-bloomberg

Copy link
Copy Markdown
Contributor Author

2026-04-05T15:59:16.441 INFO:tasks.util.rgw:rgwadmin: c1.client.0 : ['object', 'rm', '--bucket', 'cjxsoi-55', '--object', 'obj', '--object-version', 'xIkKJID.gwu-IIVS6oZerrbFGqvt6QA', '--cluster', 'c1', '--debug-rgw', '0', '--debug-ms', '0']
<-- ** this is supposed to be done on cluster c2

the teuthology.log corresponding to the realms/two-zonegroup configuration shows two zones a1 and a2 in zonegroup a, and two zones b1 and b2 in zonegroup b. zones a1 and a2 are hosted on cluster c1, while b1 and b2 are hosted on cluster c2

your test case is only using the primary zonegroup a, so everything it does is against cluster c1:

def test_versioned_bucket_sync_disable_enable_object_delete():
    zonegroup = realm.master_zonegroup()
    zonegroup_conns = ZonegroupConns(zonegroup)

so i think the radosgw-admin command's --cluster argument is correct, but is missing --rgw-zone and --rgw-zonegroup arguments to specify the correct zone. there's a zone.zone_args() that adds these arguments, try adding that to the cmd:

     # Delete the second object version
     cmd = ['object', 'rm', '--bucket', bucket.name, '--object', obj, '--object-version', version_id_2]
-    secondary.zone.cluster.admin(cmd)
+    secondary.zone.cluster.admin(cmd + secondary.zone.zone_args())

let me try this.
Not sure why everything works well in the other multisite test though

@jzhu116-bloomberg

jzhu116-bloomberg commented Apr 7, 2026 •

Copy link
Copy Markdown
Contributor Author

let me try this. Not sure why everything works well in the other multisite test though

Ah never mind. I know why now

@cbodley

cbodley commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

^ i pushed a squash commit to #67109 that adds zone_args() to my test_versioned_lifecycle_deletes test case

@jzhu116-bloomberg

Copy link
Copy Markdown
Contributor Author

^ i pushed a squash commit to #67109 that adds zone_args() to my test_versioned_lifecycle_deletes test case

I'll bring that in

@jzhu116-bloomberg

Copy link
Copy Markdown
Contributor Author

@smanjara
smanjara merged commit ea612be into ceph:main Apr 13, 2026
6 checks passed
@github-actions

Copy link
Copy Markdown

This is an automated message by src/script/redmine-upkeep.py.

I found one or more Fixes: tags in the commit messages in

git log ea612be2289b5e68410fc7d228321d612c89cb8f^..ea612be2289b5e68410fc7d228321d612c89cb8f

The referenced tickets are:

Those tickets do not reference this merged Pull Request. If this Pull Request merge resolves any of those tickets, please update the "Pull Request ID" field on each ticket. A future run of this script will appropriately update them.

Update Log: https://github.com/ceph/ceph/actions/runs/24366893667

@jzhu116-bloomberg

jzhu116-bloomberg commented Apr 14, 2026 •

Copy link
Copy Markdown
Contributor Author

Sorry @smanjara , it looks like I had a misunderstanding on the merge -- I thought it was "merge with squash", hence didn't squash my commits . Since this PR is already in the main, is there anything I can do to clean it up?

BBoozmen added a commit to BBoozmen/ceph that referenced this pull request Aug 9, 2026
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]>
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.

3 participants