Skip to content

rgw: group lifecycle versioned deletes to reduce OLH contention - #67700

Merged
anrao19 merged 2 commits into
ceph:mainfrom
mheler:wip-lc-versioned-deletes
May 20, 2026
Merged

anrao19 merged 2 commits into
ceph:mainfrom
mheler:wip-lc-versioned-deletes

Conversation

@mheler

@mheler mheler commented Mar 6, 2026 •

Copy link
Copy Markdown
Contributor

When lifecycle expires several versions of the same key, each delete does a read-modify-write of the OLH. Since they all hit the same bucket index shard, these updates contend with each other and only the final result matters.

This pulls the OLH grouping logic out of multi-delete into rgw::multi_delete::dispatch() and reuses it in lifecycle expiration. Versions of the same key are buffered during listing, and all but the last delete skip the OLH update.

No change in behavior for non-versioned buckets or keys with a single version.

Testing with 100k keys (distribution: 45% x1 version, 25% x2, 15% x3, 10% x4, 5% x9) and 128 LC workers, lifecycle processing dropped from 6m43s to 3m23s — roughly a 50% reduction in wall time.

Baseline

time bin/radosgw-admin lc process --bucket=test-multi-del-1 \
  --rgw-lc-debug-interval=1 --rgw_lc_max_wp_worker=128 \
  --debug_rgw_lifecycle=50 --debug_rgw=50

real    6m42.704s
user    1m53.995s
sys     0m59.943s

This PR

time bin/radosgw-admin lc process --bucket=test-multi-del-2 \
  --rgw-lc-debug-interval=1 --rgw_lc_max_wp_worker=128 \
  --debug_rgw_lifecycle=50 --debug_rgw=50

real    3m23.490s
user    1m6.454s
sys     0m35.938s

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.

@mheler
mheler requested a review from a team as a code owner March 6, 2026 21:56
@github-actions github-actions Bot added the rgw label Mar 6, 2026
@mheler
mheler requested review from cbodley and mattbenjamin March 9, 2026 21:40
@markhpc
markhpc requested a review from kchheda3 March 12, 2026 15:36
@jmundack

jmundack commented Mar 13, 2026 •

Copy link
Copy Markdown
Contributor

This is awesome!

Can we add a tracker? Abd potentially backport this to tentacle and squid?,

Also - is there some unit testing we can do? if not - integration tests?

@mheler

mheler commented Mar 14, 2026 •

Copy link
Copy Markdown
Contributor Author

This is awesome!

Can we add a tracker? Abd potentially backport this to tentacle and squid?,

Also - is there some unit testing we can do? if not - integration tests?

@jmundack A tracker isn't a bad idea, but this is largely a code refactoring for performance reasons not really a bug or a feature. As for a backport to Tentacle or Squid, that will be difficult considering this work relies on #66367 and #63762

Existing qa tests and s3-tests already cover the testing scenarios of deleting multiple versions of an object.

@mheler
mheler requested review from dvanders and markhpc April 1, 2026 11:59
@dvanders

dvanders commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

@mheler nice. Could you share the speedups with the default debug levels -- I'm curious if debug 50 is so expensive that we aren't seeing the true speedup yet. (Amdahl's Law)

@mattbenjamin mattbenjamin 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.

This looks fine to me, I'd like Adam or Casey to review as it's mostly spawn/async throttle logic.

@anrao19

anrao19 commented May 12, 2026

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

mheler added 2 commits May 14, 2026 15:43
Move the OLH-aware dispatch logic out of RGWDeleteMultiObj into a
standalone rgw::multi_delete::dispatch() so lifecycle expiration
can group versioned deletes of the same key and skip redundant
OLH updates.

Signed-off-by: Matthew N. Heler <[email protected]>
When multiple versions of the same key expire together, each delete
does a read-modify-write of the OLH on the same bucket index shard.

Buffer versions of the same key during listing and flush on key change.
Groups with multiple versions get pre-evaluated, then hard deletes go
through rgw::multi_delete::dispatch() which skips OLH updates on all
but the last delete. LCOpRule::process() is split into evaluate() and
execute() to support this two-phase pattern.

Non-versioned buckets and single-version groups are unchanged.

Signed-off-by: Matthew N. Heler <[email protected]>
@mheler
mheler force-pushed the wip-lc-versioned-deletes branch from 29ca43d to 51a4d6e Compare May 14, 2026 23:36
@anrao19

anrao19 commented May 18, 2026

Copy link
Copy Markdown
Contributor

pr testing is in progress .. https://tracker.ceph.com/issues/76520

pr testing completed : https://tracker.ceph.com/issues/76520 , and approved by @ivancich.
@mheler , if no further testing is needed then this pr can be merged

@anrao19

anrao19 commented May 18, 2026

Copy link
Copy Markdown
Contributor

jenkins test make check

@anrao19
anrao19 merged commit f90bcac into ceph:main May 20, 2026
6 checks passed
@mheler
mheler deleted the wip-lc-versioned-deletes branch June 18, 2026 18:28
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.

7 participants