Skip to content

fix(table): prefetch ordered splits in a bounded window - #1475

Open
XiaoHongbo-Hope wants to merge 4 commits into
apache:mainfrom
XiaoHongbo-Hope:fix/ordered-split-prefetch
Open

XiaoHongbo-Hope wants to merge 4 commits into
apache:mainfrom
XiaoHongbo-Hope:fix/ordered-split-prefetch

Conversation

@XiaoHongbo-Hope

@XiaoHongbo-Hope XiaoHongbo-Hope commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Executor tests: 14/14, including a 50,000-split, LIMIT 1 case that creates only two streams with parallelism 2.
  • Parallel read integration tests: 5/5.
  • cargo fmt --all -- --check and git diff --check passed.

@JingsongLi JingsongLi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

@XiaoHongbo-Hope
XiaoHongbo-Hope marked this pull request as draft November 22, 2026 02:52
@XiaoHongbo-Hope
XiaoHongbo-Hope marked this pull request as ready for review November 23, 2026 03:04
@XiaoHongbo-Hope
XiaoHongbo-Hope marked this pull request as draft November 23, 2026 03:07
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.

2 participants