Repository navigation
osd: wait for the last commits of the PGs before the op threads stop - #73179
Merged
SrinivasaBharath merged 1 commit intoNov 25, 2026
Merged
Conversation
A slow shutdown (osd_fast_shutdown=false) could leave a PG referenced
when OSD::shutdown() detached it ("has ref count of 2"), and
BlueStore::umount() then failed its assert on the reference count of
the PG's collection.
The map that marks the stopping OSD down starts a new interval in each
PG just as the shutdown begins. The on-commit callback of that peering
transaction holds a FlushState, and the FlushState holds the PG.
PG::shutdown() waits until the transactions of the PG are submitted,
not until they commit. The store queues the on-commit callbacks of a
PG to the context queue of its shard, where the op threads of a
stopping OSD delete them. When the commit came after the op threads
had stopped, its callback stayed in the queue and kept the PG, and the
PG's collection, past the detach of the PG and the umount of the store.
Now OSD::shutdown() waits until the transactions of each PG have
committed, after it shut the PGs down and while the op threads still
run. The waiter signals when it is released, because the op threads
delete it instead of running it. The wait takes as long as the last
commits, a few milliseconds.
Fixes: https://tracker.ceph.com/issues/82196
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Kyle Bader <[email protected]>
5 of 14 tasks
rzarzynski
approved these changes
Oct 28, 2026
Contributor
|
This PR has been added to wip-bharath10-testing-20261109.054620-main. |
|
This is an automated message by src/script/redmine-upkeep.py. I have resolved the following tracker ticket due to the merge of this PR: No backports are pending for the ticket. If this is incorrect, please update the tracker |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In a slow shutdown (
osd_fast_shutdown=false), a PG was sometimes still referenced at its detach inOSD::shutdown()("has ref count of 2").BlueStore::umount()then failed its assert on the reference count of the PG's collection.The map that marks the stopping OSD down starts a new interval in each PG, just as the shutdown begins. The on-commit callback of that peering transaction holds a FlushState, and the FlushState holds the PG.
PG::shutdown()waits until the transactions of the PG are submitted, not until they commit.The store queues the on-commit callbacks of a PG to the context queue of its shard. The op threads of a stopping OSD delete them. When the commit came after the op threads stopped, its callback stayed in the queue and kept the PG and its collection past the umount.
Now
OSD::shutdown()waits until the transactions of each PG committed, after it shut the PGs down and while the op threads still run. The op threads delete the waiter instead of running it, so the waiter signals at its release. The wait takes as long as the last commits, a few milliseconds.Fixes: https://tracker.ceph.com/issues/82196
Testing
The assert showed in the slow-stop standalone tests of the S3 over RDMA series (#73164). Before the fix, 3 of 20 runs of one of these tests hit the assert at umount. After it, all 60 runs of three such tests passed. Those runs were on an older main. This pull request adds no test.
Checklist