Skip to content

umbrella: crimson/os/alienstore: make CnLog::_flush non-blocking - #70342

Merged
batrick merged 1 commit into
ceph:umbrellafrom
ronen-fr:wip-rf-69838-umbrella
Aug 3, 2026
Merged

batrick merged 1 commit into
ceph:umbrellafrom
ronen-fr:wip-rf-69838-umbrella

Conversation

@ronen-fr

@ronen-fr ronen-fr commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

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)

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)
@ronen-fr
ronen-fr requested a review from a team as a code owner July 20, 2026 15:33
@github-actions github-actions Bot added this to the umbrella milestone Jul 20, 2026
github-actions[bot]

This comment was marked as outdated.

@github-actions github-actions Bot added the releng-audit-fail Release engineering: failed backport verification audit. label Jul 20, 2026
@ronen-fr ronen-fr added bug-fix backport and removed releng-audit-fail Release engineering: failed backport verification audit. labels Jul 20, 2026
@github-actions github-actions Bot added the releng-audit-pass Release engineering: passed backport verification audit. label Jul 20, 2026
@ronen-fr
ronen-fr requested review from Matan-B and rzarzynski July 20, 2026 16:51
@batrick

batrick commented Jul 29, 2026

Copy link
Copy Markdown
Member

jenkins test windows

@batrick batrick modified the milestones: umbrella, v21.1.1 Jul 29, 2026

@rzarzynski rzarzynski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM – straightforward backport.

@yuriw

yuriw commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to wip-yuri9-testing-20260729.135117-umbrella.

@ronen-fr

ronen-fr commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

jenkins test windows

@batrick
batrick merged commit dd8f3d2 into ceph:umbrella Aug 3, 2026
12 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport bug-fix crimson needs-qa releng-audit-pass Release engineering: passed backport verification audit. wip-yuri9-testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants