Repository navigation
Fix flaky test 03583_rewrite_in_to_join (row ordering) - #108561
Conversation
The data SELECTs read FROM numbers() without an ORDER BY. With rewrite_in_to_join the IN/NOT IN subquery becomes a LEFT JOIN whose output is produced by parallel JoiningTransform lanes (EXPLAIN PIPELINE shows Resize 32->16 over 16 lanes), so row order depends on which lane finishes first. The result multiset is always correct, only the order varies, which trips the reference comparison. Add ORDER BY number to the affected SELECTs. The EXPLAIN rewrite assertions and the serverError checks are unchanged, and no result value changes (only ordering becomes deterministic). Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-0:20260626-003700 |
|
cc @dhtclk — could you review this? The data SELECTs in 03583_rewrite_in_to_join had no ORDER BY, and with rewrite_in_to_join the IN/NOT IN subquery becomes a LEFT JOIN whose output is produced by parallel JoiningTransform lanes, so row order was nondeterministic (failed on Fast test + 5 other unrelated PRs, 0 on master). This adds ORDER BY number to the affected SELECTs; the EXPLAIN rewrite assertions and serverError checks are unchanged and no result value changes. |
|
Workflow [PR], commit [985c436] Summary: ✅ AI ReviewSummaryThis PR is a scoped test-only fix for Missing context / blind spots
Final VerdictStatus: ✅ Approve |
CI finish ledger — 985c436Every failure below has an owner; none is in this PR's diff (
Session id: cron:our-pr-ci-monitor:20260626-173000 |
LLVM Coverage Report
Changed lines: No C/C++ source files changed — skipping uncovered code analysis. Newly covered by added/modified tests: 360 line(s), 23 function(s) across 123 file(s) · Details Top files
|
4603264
…in-to-join-order-by Fix flaky test 03583_rewrite_in_to_join (row ordering)
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Flaky test fix. The data
SELECTs in03583_rewrite_in_to_joinreadFROM numbers()with noORDER BY. Withrewrite_in_to_join, theIN/NOT INsubquery is rewritten to aLEFT JOINwhose output is produced by parallelJoiningTransformlanes (EXPLAIN PIPELINEshowsResize 32 -> 16over 16 lanes), so the row order depends on which lane finishes first. The result multiset is always correct; only the order varies, which trips the.referencecomparison. Fails on Fast test too (no settings randomization), so it is ordering, not a setting interaction.Added
ORDER BY numberto the affectedSELECTs. TheEXPLAINrewrite assertions and theserverErrorchecks are unchanged, and no result value changes (only ordering becomes deterministic).Repro (parallel JOIN lanes scramble order):
clickhouse local --max_threads 16 --max_block_size 1 --join_algorithm parallel_hashover the test produced 11 distinct orderings in 20 runs withoutORDER BY, and a single stable output in 30/30 runs with it.Failed across 6 unrelated PRs in 30 days, 0 on master.
Version info
26.7.1.243(included in26.7and later)