Skip to content

Retain composite and disk parent rows until retention pressure - #337

Merged
yatesdr merged 1 commit into
NVIDIA:mainfrom
yatesdr:fix/selene-composite-parent-rows
Nov 18, 2026
Merged

yatesdr merged 1 commit into
NVIDIA:mainfrom
yatesdr:fix/selene-composite-parent-rows

Conversation

@yatesdr

@yatesdr yatesdr commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #335.

Retain composite and disk parent rows until retention pressure

Composite and disk stores eagerly removed redundant parent rows even
with retention headroom. A single child does not establish that its
parent's endpoint is unused: a later conversation branch can still
resume there. MemoryStore already keeps such rows until pressure
(#264, #302).

Reclaim eligible rows in least-recently-used order under retention or
incoming-allocation pressure, stopping once headroom returns, and do it
before disk maintenance hands any leaf to the pool (leaves already held
for handover count toward the target). A composite spill is lossless (the
row goes to disk with the record), so it does not thin first; rows are
reclaimed where an allocation needs room. Share candidate ordering and free-retention calculations with
MemoryStore, queue restored memory rows, and remove queued keys at every
removal site (as MemoryStore does), so the queue holds only resident
records. Keep the #336 BACKLOG / 2 cap on in-flight truncates; at the cap,
make_room can evict a whole record before reclaiming further rows.

Parent endpoints stay reusable while space remains, and colder redundant
rows go before any other record under pressure. The disk tier now writes
the row of every spilled parent, which costs write bytes up front and a
truncate later under pressure.

Six regressions fail without the change and pass with it: rows kept
with headroom and reclaimed in access order under pressure (composite and
disk), rows reclaimed before disk maintenance retires leaves, and the thinning queue holding only resident records after expiry,
eviction, discard and retirement (composite and disk). The composite,
disk-store and memory modules pass on Linux.

Not tested: GPU serving with a branching workload.

Linux (cn4): selene composite, disk_store, memory and shared::index, 157 passed.

Composite and disk stores eagerly removed redundant parent rows even
with retention headroom. A single child does not establish that its
parent's endpoint is unused: a later conversation branch can still
resume there. MemoryStore already keeps such rows until pressure
(NVIDIA#264, NVIDIA#302).

Reclaim eligible rows in least-recently-used order under retention or
incoming-allocation pressure, stopping once headroom returns, and do it
before disk maintenance hands any leaf to the pool (leaves already held
for handover count toward the target). A composite spill is lossless (the
row goes to disk with the record), so it does not thin first; rows are
reclaimed where an allocation needs room. Share candidate ordering and free-retention calculations with
MemoryStore, queue restored memory rows, and remove queued keys at every
removal site (as MemoryStore does), so the queue holds only resident
records. Keep the NVIDIA#336 BACKLOG / 2 cap on in-flight truncates; at the cap,
make_room can evict a whole record before reclaiming further rows.

Parent endpoints stay reusable while space remains, and colder redundant
rows go before any other record under pressure. The disk tier now writes
the row of every spilled parent, which costs write bytes up front and a
truncate later under pressure.

Six regressions fail without the change and pass with it: rows kept
with headroom and reclaimed in access order under pressure (composite and
disk), rows reclaimed before disk maintenance retires leaves, and the thinning queue holding only resident records after expiry,
eviction, discard and retirement (composite and disk). The composite,
disk-store and memory modules pass on Linux.

Not tested: GPU serving with a branching workload.

Design-Signed-Off-By: yatesdr; design-review=ed22
@yatesdr
yatesdr force-pushed the fix/selene-composite-parent-rows branch from a0c3ebe to a66ca82 Compare November 18, 2026 22:25
@yatesdr
yatesdr merged commit 303b9bc into NVIDIA:main Nov 18, 2026
2 checks passed
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