Skip to content

Fix flaky 03394 shuffle-join tests under join-order randomization - #112188

Merged
alexey-milovidov merged 1 commit into
masterfrom
fix-03394-shuffle-join-runtime-filter-randomize
Jul 28, 2026
Merged

alexey-milovidov merged 1 commit into
masterfrom
fix-03394-shuffle-join-runtime-filter-randomize

Conversation

@alexey-milovidov

Copy link
Copy Markdown
Member

03394_distributed_shuffle_join_with_in and 03394_distributed_shuffle_join_with_aggregation assert that BuildRuntimeFilter appears in the EXPLAIN plan, but neither pins the two settings that decide whether the runtime join filter is built at all.

Reproduced locally with the exact randomized setting set from the CI report below and minimized to a two-setting combination: query_plan_optimize_join_order_randomize nonzero together with join_runtime_filter_min_probe_rows above the estimated probe size. Join-order randomization changes which side is the probe side, and joinRuntimeFilter then skips the filter because the probe side is estimated to produce at most join_runtime_filter_min_probe_rows rows, so the BuildRuntimeFilter step disappears from the plan and the plan diff fails. Neither setting reproduces the failure alone.

Both settings are pinned, mirroring 03394_distributed_shuffle_join_with_prewhere, which already pins them for the same reason.

Verified: with the randomized setting set the plan output of both tests now matches the reference exactly (before the fix BuildRuntimeFilter was absent in both).

CI report where this was observed: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110321&sha=fbebd96fb7f9dcee3d3bdb40df67558ffeaa1b40&name_0=PR&name_1=Stateless%20tests%20%28amd_msan%2C%20WasmEdge%2C%20parallel%2C%201%2F2%29

Related: #110321
Related: #109386

Changelog category (leave one):

  • CI Fix or improvement (changelog entry is not required)

`03394_distributed_shuffle_join_with_in` and
`03394_distributed_shuffle_join_with_aggregation` assert that
`BuildRuntimeFilter` appears in the `EXPLAIN` plan, but neither pins the two
settings that decide whether the runtime join filter is built at all.

Reproduced locally with the exact randomized setting set from the CI report
(https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110321&sha=fbebd96fb7f9dcee3d3bdb40df67558ffeaa1b40&name_0=PR&name_1=Stateless%20tests%20%28amd_msan%2C%20WasmEdge%2C%20parallel%2C%201%2F2%29,
PR #110321) and minimized to a
two-setting combination: `query_plan_optimize_join_order_randomize` nonzero
together with `join_runtime_filter_min_probe_rows` above the estimated probe
size. Join-order randomization changes which side is the probe side, and
`joinRuntimeFilter` then skips the filter because the probe side is estimated
to produce at most `join_runtime_filter_min_probe_rows` rows, so the
`BuildRuntimeFilter` step disappears from the plan and the plan diff fails.
Neither setting reproduces the failure alone.

Pin both, mirroring `03394_distributed_shuffle_join_with_prewhere`, which
already pins them for the same reason.

Verified: with the randomized setting set the plan output of both tests now
matches the reference exactly (before the fix `BuildRuntimeFilter` was absent
in both).

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [dbd998c]

Summary: ✅


AI Review

Summary

This PR stabilizes 03394_distributed_shuffle_join_with_in and 03394_distributed_shuffle_join_with_aggregation by pinning query_plan_optimize_join_order_randomize and join_runtime_filter_min_probe_rows, which both affect whether the asserted BuildRuntimeFilter node appears in the EXPLAIN output. I checked the current diff, the existing references, related runtime-filter coverage, prior PR discussion, and the current Praktika report, and I did not find a correctness, coverage, or PR-metadata issue that warrants an inline review comment.

Final Verdict

✅ No blocking or major issues found in the current diff.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

Note: this overlaps with #112026, which pins join_runtime_filter_min_probe_rows = 0 in 03394_distributed_shuffle_join_with_aggregation.sql for the same reason. The two touch the same lines of that file, so whichever is merged second will need a trivial conflict resolution there; the query_plan_optimize_join_order_randomize pin and the 03394_distributed_shuffle_join_with_in.sql part of this pull request are unique to it.

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ok.

@alexey-milovidov alexey-milovidov self-assigned this Jul 28, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Jul 28, 2026
Merged via the queue into master with commit cb3e8c5 Jul 28, 2026
178 checks passed
@alexey-milovidov
alexey-milovidov deleted the fix-03394-shuffle-join-runtime-filter-randomize branch July 28, 2026 19:32
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants