Repository navigation
fix(table): prefetch ordered splits in a bounded window - #1475
XiaoHongbo-Hope wants to merge 4 commits into
Conversation
JingsongLi
left a comment
There was a problem hiding this comment.
The bounded ordered scheduling change has end-to-end value. All 4,994 core tests and 17 parallel-read and Data Evolution integration cases passed locally. A targeted ordered LIMIT test found a regression in speculative error propagation.
| // Ordered output needs a sliding window of individual splits. Grouping | ||
| // several splits into one stream leaves the later splits in each group | ||
| // unopened until every earlier split in that group has been emitted. | ||
| let groups = if ordered && parallelism > 1 { |
There was a problem hiding this comment.
[P2] Defer speculative split errors until an ordered LIMIT needs that split
With four equal-size splits, parallelism 2 and LIMIT 1 over a filtered read, the old grouping starts splits 0 and 2. The new window starts 0 and 1. When split 0 can return the only row requested but is delayed and split 1 errors on open, the merge surfaces split 1's error before returning any rows. I reproduced this through execute with a gated first split and a failing second split. The identical test passes on ab2eaef4 and fails on b0b1eaad in repeated runs.
For a finite ordered limit, buffer failures from speculative splits in output order and surface them when the scan reaches that split. Once the limit is satisfied, discard unused split failures with the remaining work. Unlimited ordered scans can retain their existing fail-fast behavior.
Summary
Ordered reads now prefetch splits through a bounded sliding window. A split stream is created only when a slot opens, and an empty split frees its slot immediately. Output order, LIMIT handling, and cancellation are preserved; unordered reads are unchanged.
Validation
LIMIT 1case that creates only two streams with parallelism 2.cargo fmt --all -- --checkandgit diff --checkpassed.