Skip to content

crimson/osd: replace RecoveryCloneLockManager with ObjectContextLoader::Manager - #70085

Merged
tchaikov merged 1 commit into
ceph:mainfrom
tchaikov:wip-recovery-clone-lock-raii
Sep 7, 2026
Merged

tchaikov merged 1 commit into
ceph:mainfrom
tchaikov:wip-recovery-clone-lock-raii

Conversation

@tchaikov

@tchaikov tchaikov commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

RecoveryCloneLockManager reimplemented what ObjectContextLoader::Manager already provides: RAII release, move, obc_set_accessing bookkeeping. It only needed a non-blocking read acquire, so recovery never blocks on a clone snap trim is writing. Add state_t::try_lock_for_read() and a loader factory, try_lock_cached_obc_for_read(), returning a Manager holding the lock, or nullopt.

commit_clone_overlap_plan() and set_recovery_info() now return their Managers instead of accumulating them through reference parameters, so acquiring the locks initializes the object that owns them and no caller has to remember to clear a vector before reusing it. recalc_subsets() takes the new locks before the assignment releases the old ones, so no writer can slip in between.

Releasing from a destructor is safe here but not in classic: classic's ObcLockManager must release explicitly because unlocking requeues blocked ops, which needs PG context a destructor lacks. A crimson read unlock only decrements the reader count and wakes waiters.

The explicit releases that remain are documented in place: completion boundaries release promptly because the recovering entry outlives them; error and interval-change paths release because erase()/clear() only drops the map's reference while waiters may keep the infos alive; stop() releases because the PG destroys obc_loader before recovery_backend.

Remove RecoveryCloneLockManager and the ObjectContext try_get_read_lock/put_read_lock helpers it needed.

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.

@tchaikov
tchaikov requested a review from a team as a code owner July 9, 2026 14:48
@Matan-B
Matan-B requested a review from knrt10 July 9, 2026 14:59
@Matan-B Matan-B added this to Crimson Jul 9, 2026
@Matan-B Matan-B moved this to Awaits review in Crimson Jul 9, 2026
@tchaikov
tchaikov force-pushed the wip-recovery-clone-lock-raii branch from 31f2fac to 4559e15 Compare July 9, 2026 15:12
…r::Manager

RecoveryCloneLockManager reimplemented what ObjectContextLoader::Manager
already provides: RAII release, move, obc_set_accessing bookkeeping.
It only needed a non-blocking read acquire, so recovery never blocks on
a clone snap trim is writing. Add state_t::try_lock_for_read() and a
loader factory, try_lock_cached_obc_for_read(), returning a Manager
holding the lock, or nullopt.

commit_clone_overlap_plan() and set_recovery_info() now return their
Managers instead of accumulating them through reference parameters, so
acquiring the locks initializes the object that owns them and no caller
has to remember to clear a vector before reusing it. recalc_subsets()
takes the new locks before the assignment releases the old ones, so no
writer can slip in between.

Releasing from a destructor is safe here but not in classic: classic's
ObcLockManager must release explicitly because unlocking requeues
blocked ops, which needs PG context a destructor lacks. A crimson read
unlock only decrements the reader count and wakes waiters.

The explicit releases that remain are documented in place: completion
boundaries release promptly because the recovering entry outlives them;
error and interval-change paths release because erase()/clear() only
drops the map's reference while waiters may keep the infos alive;
stop() releases because the PG destroys obc_loader before
recovery_backend.

Remove RecoveryCloneLockManager and the ObjectContext
try_get_read_lock/put_read_lock helpers it needed.

Signed-off-by: Kefu Chai <[email protected]>
@tchaikov
tchaikov force-pushed the wip-recovery-clone-lock-raii branch from 4559e15 to df5480b Compare July 15, 2026 02:40
@tchaikov

Copy link
Copy Markdown
Contributor Author

@knrt10 could you please take a look ?

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

+1, thank you.

@knrt10 knrt10 moved this from Awaits review to Needs QA in Crimson Jul 16, 2026
@perezjosibm

perezjosibm commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor
PR=wip-perezjos-crimson-only-16-07-2026-PR70085
$ teuthology-suite -s crimson-rados -p 101 --force-priority -c $PR  -f debug  --filter-out rgw  --suite-branch main --suite-repo https://github.com/ceph/ceph.git
2026-07-17 09:33:03,815.815 INFO:teuthology.suite.run:Test results viewable at 

https://pulpito-ng.ceph.com/jjperez-2026-07-17_09:26:23-crimson-rados-wip-perezjos-crimson-only-16-07-2026-PR70085-distro-debug-trial/

@perezjosibm perezjosibm moved this from Needs QA to QA in Progress in Crimson Jul 16, 2026
@perezjosibm perezjosibm moved this from QA in Progress to Tested in Crimson Jul 20, 2026
@Matan-B

Matan-B commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Seems there are plenty of infra:

infrastructure issue: "Wanted 2 disks of ~1700 GB (rotational=False), but only matched 1: ['nvme0n1']"

@perezjosibm, can we please retest this?

@Matan-B Matan-B moved this from Tested to Needs QA in Crimson Aug 3, 2026
@perezjosibm

perezjosibm commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor
PR=wip-perezjos-crimson-only-03-08-2026-PR70085
$ teuthology-suite -s crimson-rados -p 101 --force-priority -c $PR  -f debug  --filter-out rgw  --suite-branch main --suite-repo https://github.com/ceph/ceph.git
2026-08-04 06:54:55,189.189 INFO:teuthology.suite.run:Test results viewable at 

https://pulpito-ng.ceph.com/jjperez-2026-08-04_06:49:03-crimson-rados-wip-perezjos-crimson-only-03-08-2026-PR70085-distro-debug-trial/

  • 36 failed with infrastructure issue: 'sudo yum -y install https://dl.fedoraproject.org/pub/epel/9/Everything/...'
  • 4 failed with infrastructure issue: 'sudo yum install -y kernel'
    will look at the remaining 11 failed jobs.

Attempting a re-run:

$ teuthology-suite --rerun jjperez-2026-08-04_06:49:03-crimson-rados-wip-perezjos-crimson-only-03-08-2026-PR70085-distro-debug-trial -m trial -p 101 --force-priority -c $PR -f debug --suite-branch main --suite-repo https://github.com/ceph/ceph.git
026-08-12 13:52:04,921.921 INFO:teuthology.suite.run:Scheduled 50 jobs in total.
2026-08-12 13:52:06,727.727 INFO:teuthology.suite.run:Test results viewable at 

https://pulpito-ng.ceph.com/jjperez-2026-08-12_13:50:25-crimson-rados-wip-perezjos-crimson-only-03-08-2026-PR70085-distro-debug-trial/

@perezjosibm perezjosibm moved this from Needs QA to QA in Progress in Crimson Aug 3, 2026
@perezjosibm perezjosibm moved this from QA in Progress to Tested in Crimson Aug 17, 2026
@Matan-B

Matan-B commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Tried rerunning as the filtered tests above had only a single snapshot test included. Had issues around flavor, moving back to needs-qa, will try to include this in my next run.

@Matan-B Matan-B moved this from Tested to Needs QA in Crimson Aug 23, 2026
@perezjosibm

perezjosibm commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

@perezjosibm perezjosibm moved this from Needs QA to QA in Progress in Crimson Sep 1, 2026
@perezjosibm perezjosibm moved this from QA in Progress to Tested in Crimson Sep 4, 2026
@tchaikov
tchaikov merged commit b58ad03 into ceph:main Sep 7, 2026
6 checks passed
@Matan-B Matan-B moved this from Tested to Merged (Main) in Crimson Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Merged (Main)

Development

Successfully merging this pull request may close these issues.

4 participants