Repository navigation
umbrella: crimson/os/alienstore: make CnLog::_flush non-blocking - #70342
Merged
Merged
Conversation
CnLog::_flush() calls alien::submit_to(...).wait(), which blocks the log flusher thread until the seastar reactor finishes outputting the log entries. When the reactor writes to stderr and the pipe buffer is full (e.g. two OSDs on the same host both dumping at debug level 20), the reactor itself blocks on the write() syscall. Meanwhile BlueStore threads filling the log buffer past m_max_new block in submit_entry() waiting for the flusher - which is waiting for the reactor - which is blocked on I/O. The kv thread cannot fire commit callbacks while it is blocked on logging, so store transactions (including osdmap persistence) hang indefinitely. Fix by moving the entries into the lambda capture so _flush() can return immediately without waiting. This is a corrected version of the approach in commit 511af83 ("crimson/os/alienstore/alien_log: _flush concurrently", PR ceph#55262), which was reverted in 4d52d1d because its lambda captured the EntryVector by reference - the caller would clear/reuse the vector before the lambda finished, causing a "pure virtual method called" crash (https://tracker.ceph.com/issues/64140). The fix here avoids that by swapping the entries out of the caller's vector and moving them into the lambda's capture, so the lambda owns them for their full lifetime. Fixes: https://tracker.ceph.com/issues/77826 Fixes (failure of the 1st attempt): https://tracker.ceph.com/issues/64140 Assisted-by: Claude <claude.ai> Signed-off-by: Ronen Friedman <[email protected]> (cherry picked from commit e4fa504)
Member
|
jenkins test windows |
rzarzynski
approved these changes
Jul 29, 2026
rzarzynski
left a comment
Contributor
There was a problem hiding this comment.
LGTM – straightforward backport.
Contributor
|
This PR has been added to wip-yuri9-testing-20260729.135117-umbrella. |
Contributor
Author
|
jenkins test windows |
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.
CnLog::_flush() calls alien::submit_to(...).wait(), which blocks the log flusher thread until the seastar reactor finishes outputting the log entries. When the reactor writes to stderr and the pipe buffer is full (e.g. two OSDs on the same host both dumping at debug level 20), the reactor itself blocks on the write() syscall. Meanwhile BlueStore threads filling the log buffer past m_max_new block in submit_entry() waiting for the flusher - which is waiting for the reactor - which is blocked on I/O. The kv thread cannot fire commit callbacks while it is blocked on logging, so store transactions (including osdmap persistence) hang indefinitely.
Fix by moving the entries into the lambda capture so _flush() can return immediately without waiting.
This is a corrected version of the approach in commit 511af83 ("crimson/os/alienstore/alien_log: _flush concurrently", PR #55262), which was reverted in 4d52d1d because its lambda captured the EntryVector by reference - the caller would clear/reuse the vector before the lambda finished, causing a "pure virtual method called" crash (https://tracker.ceph.com/issues/64140). The fix here avoids that by swapping the entries out of the caller's vector and moving them into the lambda's capture, so the lambda owns them for their full lifetime.
Backport of #69838
Fixes: https://tracker.ceph.com/issues/78422
Original tracker: https://tracker.ceph.com/issues/77826
Fixes (failure of the 1st attempt): https://tracker.ceph.com/issues/64140
Assisted-by: Claude <claude.ai>
(cherry picked from commit e4fa504)