Repository navigation
Fix flaky 03915_spilling_hash_join by pinning query_plan_join_swap_table - #111500
alexey-milovidov merged 1 commit into
Conversation
The profile-events assertions depend on which physical side of a join emits non-joined rows. With query_plan_join_swap_table=auto the planner swaps build/probe sides based on row-count estimates, which randomized settings can tip, moving the JoinNonJoinedTransform counters between queries and causing result diffs. Pin the setting so the physical plan is deterministic. Related: ClickHouse#111192 Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-author-slot-1:20260722-222600 |
Internal second-model review — adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 5 findings across 1 full pass + 1 delta recheck; bounded).
Severity: ❌ blocker / Session id: cron:clickhouse-author-slot-1:20260722-222600 |
|
cc @nickitat - could you review this? It pins |
|
Workflow [PR], commit [3901b7f] Summary: ✅ AI ReviewSummaryThis PR pins Final VerdictStatus: ✅ Approve |
CI finish ledger — 3901b7fCI fully finished (Config + Finish Workflow SUCCESS, Mergeable Check SUCCESS, >20min buffer). No failing tests on this head. Every failed check has an owner; only
Session id: cron:our-pr-ci-monitor:20260724-063000 |
…-hash-join-swap-table Fix flaky 03915_spilling_hash_join by pinning query_plan_join_swap_table
Related: #111192
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Fixes flaky
03915_spilling_hash_join("result differs with reference", 0 master / 19 hits across 7 unrelated PRs in 30d; e.g. https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=111192&sha=740ce3bcdecf657aabf88e39ca1a647709b1ac3f&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20parallel%29).Root cause: the tail
profile eventsblock asserts per-queryJoinNonJoinedTransform*counters. ForLEFT/RIGHT/FULLjoins the physical side that emits non-joined rows depends on whether the planner swaps the join's build/probe sides. Withquery_plan_join_swap_table = auto(default) the swap fires when the left row estimate is smaller than the right (optimizeJoin.cpp). Those estimates come from the join-reordering statistics cache (use_hash_table_stats_for_join_reordering, randomized and on by default), so under randomized settings the cached estimates flip the swap decision, reverse the join kind, and move the counters between queries (q12/q13/q15), producing the reference diff. Query results (COUNT/SUM) stay correct; only the ProfileEvents shift. The test already pinnedquery_plan_optimize_join_order_randomize = 0but not the swap decision itself.Fix: pin
query_plan_join_swap_table = 0so the physical plan is deterministic regardless of the cached estimates. The counter assertions and spill checks are unchanged.Version info
26.8.1.137(included in26.8and later)