Spilling MergeQueue#789
Merged
frankmcsherry merged 1 commit intoTimelyDataflow:masterfrom Apr 17, 2026
Merged
Conversation
frankmcsherry
commented
Apr 15, 2026
4dbc97d to
b71b052
Compare
Member
Author
|
Caveat: I haven't read |
916ca37 to
4696b12
Compare
4696b12 to
134271c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by Claude:
Three traits in zero_copy::spill:
entries in place. Used on both sides: the writer's policy pages data out (Bytes →
Paged), the reader's policy pages data back in (Paged → Bytes).
vecs are left in a consistent state.
Consumes the handle; returns data or returns itself for retry.
One type alias:
Sync>. Factory producing matched (writer, reader) policy pairs, one per MergeQueue.
Two shipped policies:
head_reserve_bytes + threshold_bytes.
budget.
MergeQueue changes:
constructs a matched writer/reader pair. Each carries its own policy. Replaces
new_spilling and build_reader.
entries stay for the next call. Buzzes if it returns empty with data still queued,
preventing consumer stalls.
drain_into still yields Vec to callers.
Configuration via Hooks:
args. Config::try_build_with(hooks) consumes them. try_build() uses Hooks::default() (no
spill). The spill field is Option, threaded to every MergeQueue
construction site (send-side, recv-side, intra-process).
No new runtime dependencies (tempfile is dev-only). The file-backed strategy lives in
the spill_stress example as a reference implementation.