Skip to content

os/bluestore: re-bin a buffer moved between 2Q cache shards - #73753

Closed
ming1 wants to merge 2 commits into
ceph:mainfrom
ming1:wip-82910-twoq-move-age-bin
Closed

ming1 wants to merge 2 commits into
ceph:mainfrom
ming1:wip-82910-twoq-move-age-bin

Conversation

@ming1

@ming1 ming1 commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

TwoQBufferCacheShard::_move() removes a buffer from the source shard, links it on the destination's list, and then adds its length back through b->cache_age_bin, which still points at the source shard's age bin. After a PG split the moved bytes stay counted in the source shard's age bins until the buffer is next touched, and until then the destination shard updates that counter under its own lock while the source shard updates it under another. LruBufferCacheShard::_move() already re-bins through _add().

The fix points cache_age_bin at the destination's newest bin before the add. The second commit adds a gtest to unittest_bluestore_types that fails before the fix (source bins 4096, destination 0) and passes after.

Introduced by 5635183 ("common/PriorityCache: Implement Cache Age Binning", v17.1.0).

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

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)

@ming1
ming1 requested a review from a team as a code owner November 11, 2026 05:24
@ming1
ming1 requested review from aclamk and ifed01 November 18, 2026 03:39
@Jayaprakash-ibm

Copy link
Copy Markdown
Contributor

This PR has been added to wip-jaya-bs-testing-18-11-2026.

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@Jayaprakash-ibm

Copy link
Copy Markdown
Contributor

TwoQBufferCacheShard::_move() removes the buffer from the source shard,
links it on this shard's list and adds its length back through
b->cache_age_bin, which still points at the source shard's age bin. The
moved bytes stay counted in the source shard's age bins until the buffer
is next touched, and from then on two shards update one counter under
two different locks.

Point cache_age_bin at this shard's newest bin before adding, as
LruBufferCacheShard::_move() does through _add().

Introduced by 5635183 ("common/PriorityCache: Implement Cache Age
Binning", v17.1.0) on the move path from 9732b6c ("os/bluestore:
move cached items around on collection split", v12.0.1).

Fixes: https://tracker.ceph.com/issues/82910
Signed-off-by: Ming Lei <[email protected]>
Two 2Q shards, one clean buffer added to the first, then _move() to the
second as Collection::split_cache() does. The source shard's sum_bins()
must drop to zero and the destination's must count the buffer; before
the fix the source keeps the bytes and the destination shows none while
its _get_bytes() already reports the buffer.

Fixes: https://tracker.ceph.com/issues/82910
Signed-off-by: Ming Lei <[email protected]>
@ming1
ming1 force-pushed the wip-82910-twoq-move-age-bin branch from dbd8ce3 to 017732c Compare November 26, 2026 15:03
@ming1 ming1 added the needs-qa label Nov 26, 2026
@aclamk

aclamk commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Closed in favor of: 73719

@aclamk aclamk closed this Dec 1, 2026
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.

3 participants