You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Design]: add a terminal spill fallback for extreme join-key skew #26436
Follow-up from #26408 and #26412. Re-spill now has bounded depth, queue, memory, disk, and FD admission, so it cannot recurse forever. Extreme key skew can still repeatedly rewrite nearly the full partition before ending in a controlled failure.
Problem
Hash repartitioning does not make progress when most or all rows share the same partition key. Retrying with more hash spill rounds amplifies I/O and latency without reducing the working set. A bounded error is safer than unbounded work, but it is not a complete execution strategy for valid skewed joins.
Proposed direction
Detect insufficient partition-size/cardinality progress between spill rounds.
Switch to a terminal bounded-memory algorithm, such as external sort/merge or another explicitly designed skew path.
Define stop versus round-complete signaling so all participants terminate consistently.
Acceptance criteria
Adversarial all-equal and heavy-hitter distributions complete correctly within declared memory, disk, FD, and work bounds, or fail before repeated full rewrites when no terminal strategy is admissible.
Results match a nested-loop oracle for inner, left, right/full, semi/anti, single, DedupJoin, and RightDedupJoin cases in scope.
Tests cover merger/non-merger ownership, cancellation, disk exhaustion, I/O failure, and multi-round transition into the terminal path.
Progress detection has deterministic thresholds and cannot oscillate between algorithms.
Roadmap decision: #26563. Current hard depth/queue/memory/disk/FD bounds make extreme skew a controlled failure. First measure exact or consecutive no-progress rewrites with fixed-cardinality observability. Evaluate a terminal fallback only if this occurs in production and completion is a product requirement; do not implement sort-merge fallback for every join type in advance.
Closing as evidence-gated work that is not currently planned.
The current engine already bounds spill depth, queued work, memory, disk, and FD admission, so extreme skew terminates with a controlled error rather than unbounded recursion. No current workload attached to this roadmap proves consecutive near-full partition rewrites or shows that a terminal sort/merge fallback is required.
Create a new, narrower issue only when a current-main workload records partition bytes/cardinality across rounds and deterministically demonstrates insufficient progress. That issue must cover only the observed join types and preserve a controlled bounded failure when no terminal strategy is admissible.
Activity
XuPeng-SH commentedon Aug 1, 2026
Roadmap decision: #26563. Current hard depth/queue/memory/disk/FD bounds make extreme skew a controlled failure. First measure exact or consecutive no-progress rewrites with fixed-cardinality observability. Evaluate a terminal fallback only if this occurs in production and completion is a product requirement; do not implement sort-merge fallback for every join type in advance.
XuPeng-SH commentedon Aug 12, 2026
Closing as evidence-gated work that is not currently planned.
The current engine already bounds spill depth, queued work, memory, disk, and FD admission, so extreme skew terminates with a controlled error rather than unbounded recursion. No current workload attached to this roadmap proves consecutive near-full partition rewrites or shows that a terminal sort/merge fallback is required.
Create a new, narrower issue only when a current-main workload records partition bytes/cardinality across rounds and deterministically demonstrates insufficient progress. That issue must cover only the observed join types and preserve a controlled bounded failure when no terminal strategy is admissible.