Repository navigation
crimson: Implement a lock_excl_wait wrapper - #65849
Conversation
Matan-B
left a comment
There was a problem hiding this comment.
I think this should work well. The only downside here is that being unable to exl lock an object which was just now recovered is not intuitive. Perhaps it could be helpful to explain in the commit message how/why the lock is already held by load_and_lock.
We could have potentially try to not lock the object prior to it being recovered - which I think is a more robust solution - though I'm ok with merging this approach as well as this issue largely affects the suite.
|
@mohit84, can you please run this through the suite? Thanks! |
|
|
Apologies, I jumped the gun, will remove my tag |
No worries, thanks for the quick follow-up !! |
The two teuthology jobs are generating coredump but not related to this patch, both are related to the known bug https://tracker.ceph.com/issues/73343 Rest failures are related to the script/environment specific not related to the patch. |
Can you please review in the following format: https://tracker.ceph.com/projects/crimson/wiki/MAIN? |
done |
rzarzynski
left a comment
There was a problem hiding this comment.
Perhaps we want to fix it different way. Please see the comments below.
| @@ -899,7 +899,9 @@ ReplicatedRecoveryBackend::_handle_pull_response( | |||
| pull_info.stat.num_objects_recovered++; | |||
| auto manager = pg.obc_loader.get_obc_manager( | |||
| recovery_waiter.obc); | |||
| manager.lock_excl_sync(); /* cannot already be locked */ | |||
There was a problem hiding this comment.
The current implementation clearly assumes it's the crafting of a pull request cannot interleave with handling the pull response to it. That seems reasonable and, thankfully to the assertions, exposes bugs that could be even nastier than this one.
| manager.lock_excl_sync(); /* cannot already be locked */ | ||
| // Call lock_excl_wait if the lock is already held by load_and_lock_(head|clone) | ||
| // and has not been released yet. | ||
| co_await interruptor::make_interruptible(manager.lock_excl_wait()); |
There was a problem hiding this comment.
The patch, although small in terms of SLOCs exchanged, squeezes signalling of breakage of pretty fundamental design assumption from this single piece of the broader pull machinery. My impression is it fights with the symptom instead of the underlying reason on why the assumption is broken.
If this really is all about send_to_osd() being called within with_obc(), then way simpler (from the point-of-view of the entire pull subsystem) change would be to message the peer at the very end, when every single continuation in the chain has finished (send_to_osd() would go to a "dedicated lamba", after the with_obc). How about that?
There was a problem hiding this comment.
I agree it would be more cleaner, i will try the same.
|
The job is failing during upload cbt related metrics on the server mira118 |
I created #66016, Can you cherry-pick the commit to your suites and run your test again? |
Matan-B
left a comment
There was a problem hiding this comment.
lgtm, I think the first commit and the revert of it can be removed from the PR.
When testing the PR, can you please --filter-out perf until Nitzan's PR mentioned here is merged? Thanks!
| return recovery_waiter.wait_for_pull(); | ||
| }); | ||
|
|
||
| return seastar::do_with( |
There was a problem hiding this comment.
This seems like a good opportunity to swap to coroutines and avoid do_with.
There was a problem hiding this comment.
Note, this is not a blocker but a suggestion :)
| return pg.obc_loader.with_obc<RWState::RWREAD>(soid.get_head(), | ||
| [this, soid, need, &pull_op](auto head, auto) { | ||
| auto& recovery_waiter = get_recovering(soid); | ||
| recovery_waiter.pull_info.emplace(); | ||
| auto &pull_info = *recovery_waiter.pull_info; | ||
| prepare_pull(head, pull_op, pull_info, soid, need); | ||
| return seastar::now(); |
There was a problem hiding this comment.
Continuing my previous comment here, the with_obc lambda could remain non coroutine to avoid capture lifetime issues.
There was a problem hiding this comment.
I will handle the same in next patch.
|
Tests look good! |
5e1b335 to
e62e46f
Compare
done |
|
jenkins test make check |
Hey, There are still 3 commits in the PR. Can you please take a look? |
40b1dae to
a042586
Compare
|
jenkins test make check |
|
jenkins test docs |
|
jenkins test docs |
|
Might need a rebase: #66059 |
The with_obc() function acquires a lock before invoking the lambda it wraps. Earlier the lambda itself called send_to_osd() which returns a future to with_obc. If a future is not resolved immediately and a response could arrive and trigger handle_pull_response() which attempts to acquire an exclusive lock. Because a future is not returned yet to with_obc() so the original lock is still holding by with_obc and handle_pull_response() throw an assertion failure due to that osd is crashed. Solution: Move send_to_osd() call outside with_obc lambda so that the lock is released before handle_pull_response() is triggered. Fixed: https://tracker.ceph.com/issues/71861 Signed-off-by: Mohit Agrawal <[email protected]>
a042586 to
9a459eb
Compare
|
jenkins test docs |
|
jenkins test make check |
The wrapper returns a future immediately if the lock is available otherwise wait asynchronously
Fixes: https://tracker.ceph.com/issues/71861
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.