Skip to content

fix(umbp): an in-place SSD read counts as an access - #784

Merged
TianDi101 merged 2 commits into
fix/umbp-ssd-segment-reclaimfrom
fix/umbp-ssd-inplace-read-touch
Oct 16, 2026
Merged

TianDi101 merged 2 commits into
fix/umbp-ssd-segment-reclaimfrom
fix/umbp-ssd-inplace-read-touch

Conversation

@TianDi101

Copy link
Copy Markdown
Collaborator

Stacked on #775.

What

With #775 the segment-file SSD tier ranks eviction from its own index, but only reads through the tier (ReadIntoPtr, ReadBatch*) refreshed that index. LocateRecord deliberately skipped the touch. It is the zero-copy path used by GDS reads and by every in-place promotion (#776). LocateRecord now touches the key like any other read.

Why

Under on_read the SSD serves nothing directly: every read is an in-place promotion (10.8M in one e2e hour), so the SSD evicted in write order regardless of reads. With promote_mode: move this lost data. A load promotes a page's c4 objects first, and the move deletes their SSD records. Their segment is then mostly dead and still looks cold, so (age+1)/live_fraction sends it next, taking the same pages' indexer objects before the load reads them. In the e2e run one get found 3 of 1,796 keys and sglang's scheduler died.

Test

SegmentReclaimTest.InPlaceReadCountsAsAnAccess: after in-place reads of segment 0, segment 1 is evicted first. Without the touch the test fails because k0 comes first. test_umbp_ssd_segment_reclaim passes 12/12, test_ssd_direct_io passes, and test_ssd_backend passes 32/32.

🤖 Generated with Claude Code

TianDi101 and others added 2 commits October 16, 2026 05:16
The segment-file tier ranks eviction by its own index, whose recency only
reads through the tier refreshed. LocateRecord, the path GDS reads and
in-place promotions take, did not touch it, so under on_read the SSD
evicted in write order whatever was read. With promote_mode move a load
that promoted a page's c4 objects left their segment mostly dead and still
"cold", so it went next, taking the same pages' indexer objects before the
load read them (an e2e run lost 1,793 of 1,796 keys in one get and sglang
died).

LocateRecord now touches the key like any read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-read-touch

# Conflicts:
#	src/umbp/include/umbp/local/tiers/sharded_ssd_tier.h
#	src/umbp/include/umbp/local/tiers/ssd_tier.h
#	src/umbp/local/tiers/sharded_ssd_tier.cpp
TianDi101 added a commit that referenced this pull request Oct 16, 2026
…ect-migration

Brings in #775 (segment reclaim) and #784, which this PR now merges after.
A reserved record's value is written through its segment's fd outside the
lock, so Reserve/Commit/AbortRecord pin that segment (and the replaced
record's) until the reservation ends, as Write does; a sharded reserve
refreshes its placement hints like a sharded write.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TianDi101
TianDi101 merged commit 2b2aa21 into fix/umbp-ssd-segment-reclaim Oct 16, 2026
TianDi101 added a commit that referenced this pull request Oct 16, 2026
…-ssd-direct-migration

# Conflicts:
#	src/umbp/distributed/peer/backend/ssd_backend.cpp
#	src/umbp/distributed/pool/peer_pool.cpp
#	src/umbp/include/umbp/distributed/peer/backend/page_backend.h
#	src/umbp/include/umbp/distributed/peer/backend/ssd_backend.h
TianDi101 added a commit that referenced this pull request Oct 16, 2026
fix(umbp): an in-place SSD read counts as an access (#793)

SSDTier::LocateRecord gave GDS and in-place migration readers a record's
fd without touching the segment index, so segment eviction could drop a
segment while a load was still reading it. It now touches the key and
its segment like any other read.

Re-lands #784, which merged into #775's branch after #775 was squashed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant