Skip to content

messages/MOSDPGPush: drop push buffers once the op is done - #72885

Merged
SrinivasaBharath merged 1 commit into
ceph:mainfrom
dvanders:wip-osd-push-history-buffers
Nov 13, 2026
Merged

SrinivasaBharath merged 1 commit into
ceph:mainfrom
dvanders:wip-osd-push-history-buffers

Conversation

@dvanders

@dvanders dvanders commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

A finished op stays in the OSD's op history (osd_op_history_size, 20 ops, for up to osd_op_history_duration, 600 s), and OpRequest::_unregistered() calls Message::clear_data() so that the history keeps the description, not the data. MOSDOp and MOSDECSubOpWrite drop their decoded buffers in clear_buffers(); MOSDPGPush did not, so every push in the history kept the object data it carried, up to osd_recovery_max_chunk.

Clearing PushOp::data alone is not enough: the xattrs in attrset are decoded as slices of the same receive buffer as the data, so even a small attribute keeps the whole push alive. This drops data, omap and attrset.

After recovery the history is typically all pushes, so an idle OSD held 20 × 4 MiB of rbd object data. It shows up in the bluestore_writing mempool, because BlueStore tagged the buffers when it wrote them.

Reproducer

vstart, 3 OSDs, pool size 3: stop osd.0, write 30 × 4 MiB objects with rados put, start osd.0, wait for active+clean.

dump_historic_ops bluestore_writing on osd.0
before 20 × MOSDPGPush 20 items, 80 MiB
with this change 20 × MOSDPGPush 0 bytes

Without the change, setting osd_op_history_size to 0 frees it too.

Confirmed independently by @ming1 in #73248: after one 4 MiB object is recovered, the target holds it in bluestore_writing for 606 s without the change and frees it at once with it.

Found while measuring OSD memory for #72884. MOSDECSubOpReadReply (buffers_read) may have the same issue on EC pools; not tested here.

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 x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

A finished op stays in the OSD's op history (osd_op_history_size, 20 ops,
for up to osd_op_history_duration, 600 s), and OpRequest::_unregistered()
calls Message::clear_data() so that the history keeps the description
and not the data. MOSDOp and MOSDECSubOpWrite drop their decoded buffers
in clear_buffers(); MOSDPGPush did not, so each push in the history kept
the object data it carried, up to osd_recovery_max_chunk.

Clearing PushOp::data alone is not enough: the xattrs in attrset are
decoded as slices of the same receive buffer as the data, so even a small
attribute keeps the whole push alive. Drop data, omap and attrset.

After recovery the history is typically all pushes, so an idle OSD held
20 x 4 MiB of rbd object data, reported in the bluestore_writing mempool
because BlueStore had tagged the buffers when it wrote them. Reproduced
on a 3-OSD vstart cluster by stopping osd.0, writing 30 x 4 MiB objects
and starting it again: afterwards dump_historic_ops showed 20 MOSDPGPush
and bluestore_writing held 20 items, 80 MiB. With this change the same
history holds 0 bytes there.

Fixes: https://tracker.ceph.com/issues/81945
Assisted-by: Claude-Code-v2.1.303:claude-opus-5-5
Signed-off-by: Dan van der Ster <[email protected]>

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

Nice catch!

@rzarzynski
rzarzynski requested a review from kamoltat October 21, 2026 10:00
@SrinivasaBharath

Copy link
Copy Markdown
Contributor

This PR has been added to wip-bharath15-testing-20261102.042818-main.

@ronen-fr

Copy link
Copy Markdown
Contributor

@SrinivasaBharath
SrinivasaBharath merged commit ec322a5 into ceph:main Nov 13, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants