Repository navigation
docs(design): dedicated drain_parallel consumer thread for ReorderBuffer (#1545) - #4231
Merged
Merged
Conversation
Add a design note that inventories the current two-thread delta-drain/delta-reorder topology, proves the ordering contract is preserved by the per-result sequence key, sketches the single-thread alternative, and recommends deferring the refactor until the drain_parallel_alternatives bench from #4214 lands. Includes proposed metric additions (force_insert counter, drain batch size and pause histograms) that should land independently as a prerequisite to any later capacity-contract work.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Add a design note that inventories the current two-thread delta-drain/delta-reorder topology, proves the ordering contract is preserved by the per-result sequence key, sketches the single-thread alternative, and recommends deferring the refactor until the drain_parallel_alternatives bench from #4214 lands. Includes proposed metric additions (force_insert counter, drain batch size and pause histograms) that should land independently as a prerequisite to any later capacity-contract work.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Add a design note that inventories the current two-thread delta-drain/delta-reorder topology, proves the ordering contract is preserved by the per-result sequence key, sketches the single-thread alternative, and recommends deferring the refactor until the drain_parallel_alternatives bench from #4214 lands. Includes proposed metric additions (force_insert counter, drain batch size and pause histograms) that should land independently as a prerequisite to any later capacity-contract work.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
Add a design note that inventories the current two-thread delta-drain/delta-reorder topology, proves the ordering contract is preserved by the per-result sequence key, sketches the single-thread alternative, and recommends deferring the refactor until the drain_parallel_alternatives bench from #4214 lands. Includes proposed metric additions (force_insert counter, drain batch size and pause histograms) that should land independently as a prerequisite to any later capacity-contract work.
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
concurrent_deltaconsumer (two threads:delta-drainrunsdrain_parallel_intoinsiderayon::scope;delta-reorderowns theReorderBufferand drains a bounded streaming channel;force_insertfallback onconsumer.rs:193breaks deadlocks by silently growing the ring).drain_parallel_intomay reshuffle within a batch, but the producer-stampedsequenceon everyDeltaResultreassembles the wire order throughReorderBuffer::insert/drain_ready.rayon::scopeand a SPSC ring in place of the bounded channel), discusses backpressure in both directions, and analyses interaction with theforce_insertsmell (refactor does not remove it; capacity contract change does).drain_parallel_alternativesbench from bench(engine): drain_parallel alternatives at 10K/100K items (#1682) #4214 lands, and landing theforce_insertcounter plus drain batch/pause histograms first.Doc:
docs/design/drain-parallel-consumer-thread.md. No code changes.Test plan
fmt+clippypasses (doc-only change, no code touched).