Repository navigation
crimson: Trigger a wake operation via acquire_throttle - #61647
Conversation
|
jenkins test make check |
9349b4f to
b92408c
Compare
|
jenkins test make check |
|
I have tested the patch for large pending recovery data something like below
|
There was a problem hiding this comment.
I think we do need to increment in_progress here.
There was a problem hiding this comment.
If we take the acquire_throttle path below, wake() always increments in_progress when it wakes the item. This path should be symmetric, if we return std::nullopt, we're telling the caller that it did acquire the throttle, so we need to behave the same way.
The bug is probably that 14e068f didn't introduce a mechanism to release the throttle. Prior to that commit, the only way to acquire throttle was via with_throttle_while which guaranteed that release_throttle would be invoked after the passed function executed.
@xuxuehan Perhaps there's a mechanism to release the throttle I'm missing?
There was a problem hiding this comment.
Yes you are correct here we missed to release a throttle. I thin we can call wait() before return nullopt otherwise it will be like a deadlock kind of situation. A backfill call try_acquire_throttle_now() via budget_available() and gets immediately success(std::nullopt) and in_progress increase before any pending operation in scheduler are woken up. The pending operations in scheduler remain stuck because wake() does not get a chance to run due to condition check (in_progress < max_in_progress) is failed.
There was a problem hiding this comment.
Yes, but if it takes the other pathway, it'll leak an in_progress because acquire_throttle always increments it. As long as backfill doesn't release the throttle (at present, there isn't even an interface to do so, release_throttle() is private...), it seems impossible to use try_acquire_throttle_now() usefully.
I think the only fix for now is to comment out the code in budget_available() and have it unconditionally return true until we add a mechanism for that interface to release the throttle (ideally by returning a ThrottleHandle RAII object which does it in the destructor).
There was a problem hiding this comment.
I tried to call it release_throttle after make it public but i am not getting any progress in recovery. Need to spend more time to resolve it, for the time being i will comment a code in budget_available().
There was a problem hiding this comment.
If we take the acquire_throttle path below, wake() always increments in_progress when it wakes the item. This path should be symmetric, if we return std::nullopt, we're telling the caller that it did acquire the throttle, so we need to behave the same way.
The bug is probably that 14e068f didn't introduce a mechanism to release the throttle. Prior to that commit, the only way to acquire throttle was via with_throttle_while which guaranteed that release_throttle would be invoked after the passed function executed.
@xuxuehan Perhaps there's a mechanism to release the throttle I'm missing?
Sorry for the late reply, I missed this comment.
I think I forgot to implement the releasing in that PR after a major modification. Will add it soon.
There was a problem hiding this comment.
This fix is unrelated to the in_progress change, but seems correct. Calling wake() unconditionally would also work.
There was a problem hiding this comment.
It might make sense to pull this out into its own PR. Generally, try not mix unrelated fixes into the same commit.
There was a problem hiding this comment.
Removing this is reasonable -- I think I meant this for debugging purposes but we can always readd it later. Same comment as above though, it's unrelated to the other two changes and should be in its own commit (fine to include it as part of a larger PR though).
There was a problem hiding this comment.
Personally, I would prefer keeping it for logging purposes. It's probably also a good opportunity to add more logs around other OperationThrottler functions.
There was a problem hiding this comment.
I would handle it via separate PR.
b92408c to
5b4d6df
Compare
|
jenkins test make check |
|
jenkins test make check |
Matan-B
left a comment
There was a problem hiding this comment.
We should separate the commit here into two:
- call wake unconditionally
- hide out budget_available code due to to the bug described.
Can you please also introduce a ticket (explaining why this is commented out) referenced as a comment for future readers? That way we could track this as needed to be implemented.
The background recovery is not showing any progress for crimson when crimson_osd_scheduler_concurrency is set more than 0. After read the source code it seems the recovery was not showing any progress because initially the queue is empty it was waiting for a future that eventually available after call wake() so call a wake() operation to return a future. Fixes: https://tracker.ceph.com/issues/69788 Signed-off-by: Mohit Agrawal <[email protected]>
5b4d6df to
c426a2b
Compare
|
jenkins test make check |
|
jenkins test api |
|
jenkins test make check arm64 |
|
The background recovery is not showing any progress for crimson when crimson_osd_scheduler_concurrency is set more than 0. After read the source code it seems the recovery was not showing any progress because initially the queue is empty it was waiting for a future that eventually available after call wake() so call a wake() operation while a queue is empty before enqueue an entry to avoid a circuler dependency issue.
Fixes: https://tracker.ceph.com/issues/69788
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 retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windowsjenkins test rook e2e