Repository navigation
Pin join-plan randomization in 04341_autopr_mode1_apply_join - #113904
Conversation
The test asserts that automatic parallel replicas (mode 1) collects statistics on the first run and applies parallel replicas on the second for INNER/LEFT/RIGHT joins. Under randomized settings the combination of `query_plan_optimize_join_order_randomize` and a randomized `join_runtime_filter_min_probe_rows` changes the join plan, and AutoPR declines to apply for the RIGHT join (`04341_join_right_apply 0` instead of `1`). Either setting alone does not reproduce it. The test already pins `query_plan_join_swap_table` for the same reason; also pin `query_plan_optimize_join_order_randomize = 0` and `enable_join_runtime_filters = 0`. Reproduced and verified locally against a real server with a `parallel_replicas` cluster: the culprit pair fails before the pin and matches the reference after, both with and without the culprit settings. Seen in https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=76867&sha=0725a71d30d393d74b17f6d2a6208c14c69a5546&name_0=PR&name_1=Stateless%20tests%20%28amd_debug%2C%20parallel%29 (PR #76867), also failing on other PRs since 2026-08-06.
|
Workflow [PR], commit [1e0fff0] Summary: ✅ AI ReviewSummaryThis PR makes Final VerdictStatus: ✅ Approve |
…hold instead `04341_autopr_mode1_apply_join` is the only `automatic_parallel_replicas_mode=1` APPLY test covering `RIGHT JOIN` through the runtime-filtered plan, so disabling `enable_join_runtime_filters` removed that coverage. Keep it enabled and pin `join_runtime_filter_min_probe_rows` to its default (1000): the probe side of the RIGHT join (62500 rows) exceeds it, so `BuildRuntimeFilter` stays in the plan (verified via `EXPLAIN`), while both randomized settings are now deterministic. Verified against a real server with a 3-replica `parallel_replicas` cluster: reference matches both plain and under the culprit randomization pair (`query_plan_optimize_join_order_randomize=790753`, `join_runtime_filter_min_probe_rows=8600`). Co-Authored-By: Claude Fable 5 <[email protected]>
Address the AI review: with the companion #113904 still open, this branch alone left one AutoPR join test exposed to the same randomized-plan divergence. Apply the identical pin from that PR (byte-for-byte, so both PRs merge cleanly in either order): pin query_plan_optimize_join_order_randomize = 0 and keep runtime filters enabled with join_runtime_filter_min_probe_rows pinned, since this test is the only mode=1 APPLY coverage for the RIGHT JOIN plan shape with BuildRuntimeFilterStep present. Co-Authored-By: Claude Fable 5 <[email protected]>
|
🕵 The only red, Stress test (amd_tsan), is unrelated to this PR (the diff only pins settings in one stateless test). It is the known master regression from #113225: a logical error (exception) |
|
🕵 The AI Review verdict on |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction. Compile time of recompiled translation units6 translation units recompiled, 3 s compile time in total, 6 of them have a recent master baseline. |
|
🕵 CI on
|
|
Investigated. This is not the The exception is a side effect of an unrelated failure being swallowed during index analysis. From your SELECT count() = 33333 FROM null_in_subquery
WHERE i GLOBAL IN (SELECT i FROM cluster('test_cluster_1_shard_3_replicas_1_unavailable',
currentDatabase(), 'null_in_subquery') FINAL WHERE dt = 2)The fuzzer added
So the user-visible error is wrong in two ways: the query should have failed with That also explains the intermittency: Existing work does not cover this. #102192 does not touch My intended direction is to stop discarding an exception that is not about corrupt statistics: keep the best-effort behaviour for statistics deserialization and estimate problems, and rethrow anything else, so this query reports I will post the PR link here. |
|
#114121 is the separate PR. It stops statistics part pruning from executing an That is the statistics-pruning carrier only, not all of #107619. |
Under randomized settings, `query_plan_optimize_join_order_randomize` produces different cardinality estimates in the single-replica and the candidate parallel-replicas plan builds (and can flip the `join_runtime_filter_min_probe_rows` threshold in only one of them), so the plan shapes diverge, `findCorrespondingNodeInSingleNodePlan` finds no matching hash, and AutoPR skips the instrumentation or declines to apply (fail-closed) - the tests then report 0 instead of the expected value. Pin `query_plan_optimize_join_order_randomize = 0` and `enable_join_runtime_filters = 0`, as `04341_autopr_mode1_apply_join` does in ClickHouse#113904. Seen on ClickHouse#113412: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=113412&sha=d882b451a59bc6e5b1baf8b21798757e9b1c122b&name_0=PR&name_1=Stateless%20tests%20%28amd_tsan%2C%20s3%20storage%2C%20parallel%2C%203%2F3%29 Co-Authored-By: Claude Fable 5 <[email protected]>
Related: #76867
The test asserts that automatic parallel replicas (mode 1) collects statistics on the first run and applies parallel replicas on the second for
INNER/LEFT/RIGHTjoins. Under randomized settings, the combination ofquery_plan_optimize_join_order_randomizeand a randomizedjoin_runtime_filter_min_probe_rowschanges the join plan, and AutoPR declines to apply for theRIGHTjoin (04341_join_right_apply 0instead of1). Either setting alone does not reproduce the failure. The test already pinsquery_plan_join_swap_tablefor the same reason; this also pinsquery_plan_optimize_join_order_randomize = 0,enable_join_runtime_filters = 1andjoin_runtime_filter_min_probe_rows = 1000(the default). Runtime filters stay enabled - the probe side of theRIGHTjoin (62500 rows) exceeds the pinned threshold, so the plan keepsBuildRuntimeFilterand this remains the only mode-1 APPLY coverage for the runtime-filteredRIGHT JOINshape (per review).Reproduced and verified locally against a real server with a
parallel_replicascluster: the culprit pair fails before the pin and matches the reference after, both with and without the culprit settings.Seen in https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=76867&sha=0725a71d30d393d74b17f6d2a6208c14c69a5546&name_0=PR&name_1=Stateless%20tests%20%28amd_debug%2C%20parallel%29 on #76867, and CIDB shows the same failure on several other PRs (#113649, #69540, #71028) since 2026-08-06.
Changelog category (leave one):
Version info
26.8.1.1087(included in26.8and later)