Repository navigation
Pin join_runtime_filter_min_probe_rows in tests that assert runtime filter effects - #111691
Conversation
…ilter effects #104860 added the setting `join_runtime_filter_min_probe_rows` (default 1000) and randomizes it in `clickhouse-test` between 0 and 10000. Tests that assert side effects of the runtime filter being built — `BuildRuntimeFilter` in `EXPLAIN` output or `RuntimeFilterGranules*`/index-analysis counters — over probe sides of only tens to a few thousand rows now fail whenever the randomized threshold exceeds the probe size, because the filter is skipped. Pin `join_runtime_filter_min_probe_rows = 0` in those tests, restoring the behavior they were written against. Observed failing in CI: `03394_distributed_shuffle_join_with_filter`, `_with_in`, `_with_aggregation` and `04612_join_runtime_filters_index_analysis_multi_key_anti` (https://d1k2gkhrlfqv31.cloudfront.net/clickhouse-test-reports-private/json.html?PR=65003&sha=a867fe9e119f88fd563055ae403e90120a26e374&name_0=PR); the remaining tests assert the same effects with sub-threshold probe sizes. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Workflow [PR], commit [247f4ed] Summary: ✅ AI ReviewSummaryThis PR hardens runtime-filter stateless tests against Final VerdictStatus: ✅ Approve |
…y entry after merging master The branch carried the same 26.8 entry that landed on master via #111691; the merge kept both copies and the settings-history style check rejects duplicates within one version block.
…lter-min-probe-rows-flaky-tests
…ning runtime-filter repros `04303_join_runtime_filter_query_condition_cache` has a 40-row probe side and `04327_join_runtime_filter_json` uses single-row subqueries, so under the randomized `join_runtime_filter_min_probe_rows` the runtime filter is usually not built at all and the regressions they guard would pass silently. `04401_join_runtime_filter_low_cardinality_nullable` has the same blind spot when the join tables are swapped and the 150-row side becomes the probe side.
…lter-min-probe-rows-flaky-tests
The middle assertion reads the ConstantJoin "Shrinking stored blocks" log line from system.text_log, filtered by a 60-second recency window (event_time >= now() - 60). text_log.event_time is the message emission time, not the flush time, so this window races the duration of the preceding SYSTEM FLUSH LOGS. On a loaded parallel runner the flush can take tens of seconds, and the emitted line then falls out of the window, so count() returns 0 instead of 1. Measured on four failing runs, all on the parallel sanitizer jobs: the flush took 65.8s on master sha 693a303, 59.7s on PR ClickHouse#110886 sha 06b7c4b, 101.2s on PR ClickHouse#111790 and 60.9s on PR ClickHouse#111691 sha 19338ec. In each case the line's age at the assertion was at or just past the 60-second boundary (66s, 60.1s, 101s, 62s), and for the master and ClickHouse#110886 runs the server log holds the shrink line for the exact failing query id, so the shrink did happen and only the time predicate excluded it. Widen the window to 600s. This is safe because the per-test timeout is 600s, so a flush slow enough to push the emitted line past a 600s window would trip the per-test timeout first. The assertion is unchanged and never weakened: rows are scoped exactly by query_id from system.query_log filtered by log_comment and current_database = currentDatabase(), and CI assigns every test run a unique database, so the time predicate only prunes the scan. This mirrors 00177_memory_bound_merging.sh, which uses now() - 600 on the same text_log-via-query_id pattern. Reports: https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=693a303c1017477fc39aaa7706af0ec078e13fbc&name_0=MasterCI&name_1=Stateless%20tests%20%28amd_tsan%2C%20parallel%29 https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110886&sha=06b7c4b127f65dbc45d7c26d867a4801c0742209&name_0=PR&name_1=Stateless%20tests%20%28amd_tsan%2C%20parallel%29 Co-Authored-By: Claude Opus 4.8 <[email protected]>
…lter-min-probe-rows-flaky-tests
…er` repros `03913_runtime_filter_nullable_tuple` and `04051_runtime_filter_variant_type` are regression tests for `__applyFilter` returning `Nullable(UInt8)` instead of `UInt8`, but they relied on the default runtime-filter settings. Under `clickhouse-test` both `enable_join_runtime_filters` and `join_runtime_filter_min_probe_rows` are randomized, and their probe sides are 1-3 rows, so the runtime filter could be skipped entirely and the regression would pass silently. Pin `enable_join_runtime_filters = 1` and `join_runtime_filter_min_probe_rows = 0` in both, verified against their references with `clickhouse local`.
|
The only red in the previous run, `04367_distributed_plan_merge_scatter_multishard` (Stateless tests, arm_binary, parallel), is a timeout unrelated to this PR — this PR only adds `SET` lines to runtime-filter tests and does not touch `04367`. The hang is being fixed in #111762 ("Fix query hang in local execution of distributed plans"). |
…lter-min-probe-rows-flaky-tests
|
Merged `master` (351 commits, clean) to refresh CI. The single red in the previous run, I also re-ran the coverage sweep against the refreshed |
`04653_join_runtime_filters_index_analysis_refiner` asserts that `RuntimeFilterGranulesConsidered` and `RuntimeFilterGranulesDropped` are non-zero, but its probe side (`refiner_fact`) has only 2000 rows, while `clickhouse-test` randomizes `join_runtime_filter_min_probe_rows` uniformly over 1..10000. Whenever the draw exceeds 2000 no runtime filter is built at all and both counters collapse to zero, so the test prints `0 0` instead of `1 1`. All 14 failing runs in CI drew a value above 2000, the smallest being 2036. Pin `join_runtime_filter_min_probe_rows = 0`, and also pin `query_plan_optimize_join_order_randomize = 0` because the asserted granule-pruning counts depend on which side of the join builds the filter. These are the same two pins that `04490`, `04611` and `04612` already carry; the test was modelled on `04611` before they were added there. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=112296&sha=381c5ffae13e6bc74d8cdf677b773e55395ec25c&name_0=PR&name_1=Stateless%20tests%20%28amd_asan_ubsan%2C%20flaky%20check%29 Related: ClickHouse#112296 Related: ClickHouse#111691 Co-Authored-By: Claude Opus 5 <[email protected]>
The middle assertion reads the ConstantJoin "Shrinking stored blocks" log line from system.text_log, filtered by a 60-second recency window (event_time >= now() - 60). text_log.event_time is the message emission time, not the flush time, so this window races the duration of the preceding SYSTEM FLUSH LOGS. On a loaded parallel runner the flush can take tens of seconds, and the emitted line then falls out of the window, so count() returns 0 instead of 1. Measured on four failing runs, all on the parallel sanitizer jobs: the flush took 65.8s on master sha 693a303, 59.7s on PR ClickHouse#110886 sha 06b7c4b, 101.2s on PR ClickHouse#111790 and 60.9s on PR ClickHouse#111691 sha 19338ec. In each case the line's age at the assertion was at or just past the 60-second boundary (66s, 60.1s, 101s, 62s), and for the master and ClickHouse#110886 runs the server log holds the shrink line for the exact failing query id, so the shrink did happen and only the time predicate excluded it. Widen the window to 600s. This is safe because the per-test timeout is 600s, so a flush slow enough to push the emitted line past a 600s window would trip the per-test timeout first. The assertion is unchanged and never weakened: rows are scoped exactly by query_id from system.query_log filtered by log_comment and current_database = currentDatabase(), and CI assigns every test run a unique database, so the time predicate only prunes the scan. This mirrors 00177_memory_bound_merging.sh, which uses now() - 600 on the same text_log-via-query_id pattern. Reports: https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=693a303c1017477fc39aaa7706af0ec078e13fbc&name_0=MasterCI&name_1=Stateless%20tests%20%28amd_tsan%2C%20parallel%29 https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110886&sha=06b7c4b127f65dbc45d7c26d867a4801c0742209&name_0=PR&name_1=Stateless%20tests%20%28amd_tsan%2C%20parallel%29 Co-Authored-By: Claude Opus 4.8 <[email protected]>
…erministic_condition The test asserts that a JOIN runtime filter is still moved into PREWHERE under FINAL. It pinned enable_join_runtime_filters but not the threshold the optimizer compares the probe-side ROW ESTIMATE against, and that estimate is not the real row count: query_plan_optimize_join_order_randomize, randomized by the test runner, replaces it with a uniform draw in [1, 10000000]. With the drawn pair (688112, 5964) the estimate becomes 5135, the filter is declined for a seemingly small probe side, and the assertion reads 0 instead of 1. Pin the threshold to 0, which is documented to always build the filter, so the assertion no longer depends on an estimate. Same shape as ClickHouse#111691 and ClickHouse#112467. The join order randomizer stays unpinned on purpose, so this test keeps exercising randomized join statistics. At a zero threshold the runtime-filter pass reads no row estimate, and it runs before the physical join is chosen, so a randomized estimate can no longer suppress the filter. It still varies the hash join implementation chosen afterwards; the assertion holds at both implementations observed. Co-Authored-By: Claude Opus 5 <[email protected]>
Changelog category (leave one):
#104860 added the setting
join_runtime_filter_min_probe_rows(default 1000) and randomizes it inclickhouse-testbetween 0 and 10000. Tests that assert side effects of the runtime filter actually being built —BuildRuntimeFiltersteps inEXPLAINoutput, orRuntimeFilterGranulesConsidered/RuntimeFilterGranulesDropped/index-analysis counters — over probe sides of only tens to a few thousand rows now fail whenever the randomized threshold exceeds the estimated probe size, because the runtime filter is skipped.Pin
join_runtime_filter_min_probe_rows = 0in those tests, restoring the behavior they were written against (the dedicated test04201_join_runtime_filter_min_probe_rowskeeps covering the skip itself). Observed failing since the merge of #104860, e.g.03394_distributed_shuffle_join_with_filter/_with_in/_with_aggregation(missingBuildRuntimeFilterin theEXPLAINreference) and04612_join_runtime_filters_index_analysis_multi_key_anti(index-analysis counters flip to 0): https://d1k2gkhrlfqv31.cloudfront.net/clickhouse-test-reports-private/json.html?PR=65003&sha=a867fe9e119f88fd563055ae403e90120a26e374&name_0=PR — the remaining tests in the diff assert the same effects with sub-threshold probe sizes and fail the same way under randomization.Caused by: #104860
Related: #110968
Closes: #112574
Version info
26.8.1.555(included in26.8and later)