Repository navigation
Pin plan-shape settings in 04340_autopr_input_bytes_estimation_join - #114021
Conversation
The test asserts that the input-byte autopr statistics instrument the parallelized side of a JOIN, comparing `RuntimeDataflowStatisticsInputBytes` against `ReadCompressedBytes`. Under the settings randomizer, `query_plan_optimize_join_order_randomize` and the runtime join filters (`enable_join_runtime_filters` with a low `join_runtime_filter_min_probe_rows`) restructure the plan around the JOIN, so `findReadingStep` does not instrument the parallelized reading step and the recorded `input_bytes` stays 0, tripping the guard. Pin both settings off - the test checks which side of the JOIN is instrumented, not the join-order optimizer. Example failure (flaky check in another PR, culprit settings pinned by the harness minimization): https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=96844&sha=6667b70e76f4f8cf056f3aff7aa43b05072521f3&name_0=PR&name_1=Stateless%20tests%20%28amd_msan%2C%20flaky%20check%29 PR: #96844
|
Workflow [PR], commit [ba009c7] Summary: ✅ AI ReviewSummaryThis PR pins Final Verdict✅ No remaining findings. |
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. |
… the real culprit The AI review correctly objected to pinning `enable_join_runtime_filters = 0`: it would drop coverage of the default-on runtime-filtered `JOIN` shape. Investigation of the failing runs' server logs shows the runtime filters were a red herring: - Every failing run in CIDB (10 of 10 in the last 60 days, excluding two PR-specific regressions) had `query_plan_optimize_join_order_randomize` active, while `enable_join_runtime_filters` was merely at its default. - The failing run's server log shows the actual mechanism: `optimizeJoin` draws randomized statistics separately for the single-replica plan and the parallel-replicas candidate plan (`getRandomizedStats` mixes the seed with the per-build input labels, which differ between the two builds: `t1` vs `ij_big AS t1`), the plans diverge, and `considerEnablingParallelReplicas` logs "Cannot find step with matching hash in single-node plan" -- no reading step is instrumented and `input_bytes` stays 0. - Locally, the test passes with `enable_join_runtime_filters = 1` under the failing run's full randomized-settings set, for all three join kinds. So keep `query_plan_optimize_join_order_randomize = 0` (a test-only fuzzing setting, with the corrected explanation) and pin `enable_join_runtime_filters = 1` instead of 0, making the test deterministic regression coverage for the runtime-filtered `JOIN` shape. Example failure: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=96844&sha=6667b70e76f4f8cf056f3aff7aa43b05072521f3&name_0=PR&name_1=Stateless%20tests%20%28amd_msan%2C%20flaky%20check%29 Related: #96844 Co-Authored-By: Claude Fable 5 <[email protected]>
|
🕵 CI triage for the reds on
The AI review's requested change is addressed in |
…shape-settings Pull in the fix for the flaky `04267_ttl_drop_merge_no_data_read` (#114050), which was the only CI red on this test-only pull request.
|
🕵 CI triage for the single red on
Merged |
|
lgtm, thanks. |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix flakiness of
04340_autopr_input_bytes_estimation_joinunder the settings randomizer.The test asserts that the input-byte autopr statistics instrument the parallelized side of a JOIN, comparing
RuntimeDataflowStatisticsInputBytesagainstReadCompressedByteswith a 3x tolerance.Root cause (confirmed from the failing run's server log): under
query_plan_optimize_join_order_randomize(a test-only fuzzing setting) the join-order optimizer draws randomized table statistics on every plan build, andgetRandomizedStatsmixes the seed with the per-build input labels, which differ between the single-replica plan and the parallel-replicas candidate plan (t1vsij_big AS t1). The two plans can therefore pick different join orders, the plan-hash match inconsiderEnablingParallelReplicasfails ("Cannot find step with matching hash in single-node plan"), no reading step gets instrumented, and the recordedinput_bytesstays 0, tripping the guard. Every failing run of this test in CIDB over the last 60 days (excluding two PR-specific regressions) had this setting active.Pin
query_plan_optimize_join_order_randomize = 0, and pinenable_join_runtime_filters = 1(its default) so the test deterministically keeps covering the runtime-filteredJOINshape in the instrumentation path — per review feedback, this coverage must not be randomized off.Example failure: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=96844&sha=6667b70e76f4f8cf056f3aff7aa43b05072521f3&name_0=PR&name_1=Stateless%20tests%20%28amd_msan%2C%20flaky%20check%29
Related: #96844
Version info
26.8.1.1099(included in26.8and later)