Skip to content

crimson/osd: decouple snap trim initiation from scrub completion - #68948

Merged
ronen-fr merged 1 commit into
ceph:mainfrom
ronen-fr:wip-rf-fix-trimsnap
May 21, 2026
Merged

ronen-fr merged 1 commit into
ceph:mainfrom
ronen-fr:wip-rf-fix-trimsnap

Conversation

@ronen-fr

Copy link
Copy Markdown
Contributor

Add SnapTrimInitiate operation so kick_snap_trim() no longer calls on_active_actmap() inline during scrub completion, which nested conflicting with_interruption contexts and hit an assertion.

Fixes: https://tracker.ceph.com/issues/76550

@ronen-fr
ronen-fr requested a review from rzarzynski May 16, 2026 14:42
@ronen-fr
ronen-fr requested a review from Matan-B May 16, 2026 14:43

@Matan-B Matan-B 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.

@Matan-B Matan-B added this to Crimson May 17, 2026
@Matan-B Matan-B moved this to Needs QA in Crimson May 17, 2026
@perezjosibm

perezjosibm commented May 19, 2026 •

Copy link
Copy Markdown
Contributor

@ronen-fr
ronen-fr marked this pull request as ready for review May 19, 2026 13:08
@ronen-fr
ronen-fr requested a review from a team as a code owner May 19, 2026 13:08
Add SnapTrimInitiate operation so kick_snap_trim() no longer calls
on_active_actmap() inline during scrub completion, which nested
conflicting with_interruption contexts and hit an assertion.

Fixes: https://tracker.ceph.com/issues/76550

Signed-off-by: Ronen Friedman <[email protected]>
@ronen-fr
ronen-fr force-pushed the wip-rf-fix-trimsnap branch from 03bdd55 to 6889630 Compare May 20, 2026 04:54
@ronen-fr

Copy link
Copy Markdown
Contributor Author

My own tests are OK (4 failures out of 63. None related).
Let us review Jose's

@ronen-fr

Copy link
Copy Markdown
Contributor Author

Thank you, @perezjosibm . The one non-infra failure was 220962, which turns out to be a buffer overflow (detected by ASAN) of the logger:

est 220962 — Failure Analysis

Test: crimson-rados/rbd/test_librbd_python with seastore/rbm, ASAN debug build Branch: wip-perezjos-crimson-only-19-05-2026-PR68948 Failure reason: test_librbd_python.sh timed out (3h)

Root Cause

osd.1 crashed at 06:00:18 with an ASAN heap-buffer-overflow, which caused the test to hang and eventually time out.

==32173==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x525000004900
READ of size 8240 at 0x525000004900 thread T0
0x525000004900 is located 0 bytes after 8192-byte region [0x525000002900,0x525000004900)
allocated by std::basic_filebuf::_M_allocate_internal_buffer()

Overflow backtrace:

#0  write.part.0                              (libc)
#1  std::__basic_file::xsputn                 (libstdc++)
#2  std::basic_filebuf::_M_convert_to_external (libstdc++)
#3  std::basic_filebuf::overflow              (libstdc++)
#4  std::basic_filebuf::sync                  (libstdc++)
#5  std::ostream::flush                       (libstdc++)
#6  seastar::logger::do_log                   (log.cc:358)
#7  seastar::logger::log<SocketConnection&, ..., Message&, int>
#8  seastar::logger::debug<...>
#9  operator() — IOHandler debug log
#10 for_each — iterating pending messages
#11 IOHandler::sweep_out_pending_msgs_to_sent (io_handler.cc:111)

The seastar logger was formatting a debug log message for a huge OSD operation — an osd_op with ~100+ rbd.snapshot_get, rbd.parent_overlap_get, rbd.get_flags, rbd.get_protection_status cls calls from IOHandler::sweep_out_pending_msgs_to_sent. The formatted output went through std::basic_filebuf, which has an 8192-byte internal buffer. The _M_convert_to_external tried to write 8240 bytes from that 8192-byte buffer — a 48-byte overflow. ASAN caught it and aborted osd.1.

Timeline

Time | Event -- | -- 05:51:17 | osd.1 boots 05:51:48 | test_librbd_python.sh starts 06:00:18 | osd.1 ASAN abort (heap-buffer-overflow in logging) 06:00:46 | osd.1 reported failed by osd.0 and osd.2 06:05:21 | Last passing test: TestClone::test_write (62%) 06:05:21+ | TestClone::test_list_children starts and hangs 08:51:48 | 3h timeout kills the workunit

Other OSDs

  • osd.0: Clean exit, ASAN leak report only (252KB in 1565 allocations) — no heap errors
  • osd.2: Clean exit, ASAN leak report only (3KB in 72 allocations) — no heap errors

Assessment

This is a logging subsystem bug triggered by extremely large OSD operations under ASAN. The overflow is in libstdc++'s basic_filebuf internal buffer during seastar::logger::do_log. The trigger is formatting the debug representation of an OSD op message with hundreds of cls calls in IOHandler::sweep_out_pending_msgs_to_sent. This may be a filebuf state corruption from concurrent shard access to the log output stream, or an edge case in how very large formatted strings interact with the filebuf's 8KB internal buffer on this platform (Rocky 10.1 / libstdc++ 14).

@perezjosibm perezjosibm moved this from Needs QA to Tested in Crimson May 21, 2026
@ronen-fr

Copy link
Copy Markdown
Contributor Author

jenkins test windows

@ronen-fr
ronen-fr merged commit c966086 into ceph:main May 21, 2026
6 checks passed
@ronen-fr ronen-fr moved this from Tested to Merged (Main) in Crimson May 21, 2026
@github-actions

Copy link
Copy Markdown

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
ticket and reset to Pending Backport state.

Update Log: https://github.com/ceph/ceph/actions/runs/26248666624

@github-actions

Copy link
Copy Markdown

This is an automated message by src/script/redmine-upkeep.py.

I found one or more Fixes: tags in the commit messages in

git log c966086b5791df50721948a9468509fc23bd9229^..c966086b5791df50721948a9468509fc23bd9229

The referenced tickets are:

Those tickets do not reference this merged Pull Request. If this Pull Request merge resolves any of those tickets, please update the "Pull Request ID" field on each ticket. A future run of this script will appropriately update them.

Update Log: https://github.com/ceph/ceph/actions/runs/26248666624

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Merged (Pre Umbrella cutoff)

Development

Successfully merging this pull request may close these issues.

3 participants