Repository navigation
Fix flaky test 04001_join_reorder_through_expression under randomized join order - #109499
Merged
Merged
Conversation
… join order The test asserts a specific join tree via `EXPLAIN PLAN keep_logical_steps = 1`, but the CI-randomized setting `query_plan_optimize_join_order_randomize` injects random cardinalities/NDVs into the join-order cost model when non-zero, producing a different (still valid) tree and a reference mismatch. The randomized-settings diagnosis reproduces it 100% (`--query_plan_optimize_join_order_randomize 587125`) and confirms it passes without randomization. It fails reproducibly on `master` across every architecture (see PR=0 history on play.clickhouse.com). Pin `query_plan_optimize_join_order_randomize = 0` in the test, matching the existing pattern in sibling join-order tests (`04277_parallel_replicas_join_dp_reorder`, `03960_join_order_dphyp_*`). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Contributor
|
Workflow [PR], commit [4410afb] Summary: ✅ AI ReviewSummaryThis PR pins Final Verdict
|
Algunenano
approved these changes
Jul 6, 2026
Contributor
LLVM Coverage Report
Changed lines: No C/C++ source files changed — skipping uncovered code analysis. Newly covered by added/modified tests: 118 line(s), 4 function(s) across 48 file(s) · Details Top files
|
zeekay
pushed a commit
to hanzoai/datastore
that referenced
this pull request
Sep 11, 2026
…eorder-randomize Fix flaky test 04001_join_reorder_through_expression under randomized join order
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The stateless test
04001_join_reorder_through_expressionasserts a specific join tree viaEXPLAIN PLAN keep_logical_steps = 1. The CI-randomized settingquery_plan_optimize_join_order_randomizeinjects random cardinalities/NDVs into the join-order cost model when non-zero, so the optimizer picks a different (still valid) tree and theEXPLAINoutput no longer matches the reference.The randomized-settings diagnosis pins the culprit exactly:
It reproduces 100% under the randomizer and fails reproducibly on
masteracross every architecture (arm_binary,amd_debug,amd_tsan,amd_asan_ubsan,amd_msan, …) — see thePR=0history for this test on play.clickhouse.com.The fix pins
query_plan_optimize_join_order_randomize = 0in the test, matching the existing pattern in sibling join-order tests such as04277_parallel_replicas_join_dp_reorderand the03960_join_order_dphyp_*family, which disable the same randomization because they also check a deterministicEXPLAINjoin tree.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
🤖 Generated with Claude Code
Version info
26.7.1.560(included in26.7and later)