Repository navigation
Randomize materialize_statistics_on_insert in clickhouse-test - #108511
Conversation
|
Workflow [PR], commit [10a0cbb] Summary: ✅ AI ReviewSummaryThis PR adds Findings
Final Verdict |
| "enable_optimize_predicate_expression_to_final_subquery": lambda: random.random() > 0.05, | ||
| "enable_software_prefetch_in_aggregation": lambda: random.random() > 0.05, | ||
| "allow_reorder_prewhere_conditions": lambda: random.random() > 0.05, | ||
| "materialize_statistics_on_insert": lambda: random.random() > 0.05, |
There was a problem hiding this comment.
materialize_statistics_on_insert currently defaults to 0; it was changed that way so ordinary INSERT paths avoid eager statistics builds and rely on merges or explicit MATERIALIZE STATISTICS. This generator enables the setting about 95% of the time, so randomized stateless runs mostly stop exercising the production default and make insert-heavy tests pay the eager statistics build cost whenever auto_statistics_types or explicit STATISTICS columns are present. Please keep the probability aligned with the default, for example by flipping this to an occasional non-default path (random.random() < 0.05), or make it an explicitly documented balanced choice if 50/50 coverage is intended.
Randomizing `materialize_statistics_on_insert` (it becomes `true` 95% of the time) makes freshly-inserted parts carry materialized auto-statistics (`auto_statistics_types` defaults to `minmax, uniq`), which the optimizer reads. With the production default (`false`) those statistics are only built during merges, so test parts had none. This shifts plan/EXPLAIN output and on-disk layout in several tests: - a `Statistics` step appears in `EXPLAIN indexes = 1` / JSON explain; - statistics-informed estimates change join order, prewhere condition ordering, and projection-use decisions; - a `statistics.packed` file appears in the part; - hypothetical-index `source` flips because real statistics already prune. No query results change - only plans and metadata. Pin `materialize_statistics_on_insert = 0` in the affected plan/layout tests, and disable auto-statistics (`auto_statistics_types = ''`) on the no-statistics table in `04222_hypothetical_index_statistical`, which intentionally enables the setting elsewhere. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
36796ab to
2ece445
Compare
|
@groeneai failure for |
|
@vdimir That What happened ( This is the known connection-pool desync: a pooled connection is returned out of sync, so the next query on it reads a leftover Why your PR is not to blame:
Fix is already in flight: #108854 (Fix flaky distributed query "Unexpected packet from server ...") makes |
LLVM Coverage Report
Changed lines: No C/C++ source files changed — skipping uncovered code analysis. Newly covered by added/modified tests: 96 line(s), 36 function(s) across 37 file(s) · Details Top files
|
A PR's green CI describes the master of its last run, not of its merge. PR ClickHouse#108548 merged on 2026-07-13 with CI last run on 07-01; on 07-03 master merged ClickHouse#108511, which added materialize_statistics_on_insert to the settings randomizer in tests/clickhouse-test. The PR's new test 02346_text_index_bug108519_qcc_skip_index then failed on master whenever the randomized setting was drawn (~40% of runs) and kept master red for ~7 hours until ClickHouse#110260 pinned auto_statistics_types at the table level. The merge queue already builds the exact merged state (Build (amd_binary)) but ran no stateless tests on it. Add "Stateless tests (amd_binary, flaky check)" to MergeQueueCI: it reruns the PR's new/changed stateless tests on the merge group state (the PR merged with the current master), so a semantic conflict with post-CI master changes bounces the PR from the queue instead of breaking master. The job self-skips when the PR changes no tests. Merge-queue runs use a reduced budget (20 iterations / 20 min instead of 50 iterations / 45 min): the PR CI already ran the full flaky check, and a randomized setting drawn with probability 0.4 per run escapes 20 iterations with probability 0.6^20 ~= 4e-5. Changed-file detection in merge-queue runs now uses the linked PR's paginated files list (PR_NUMBER is 0 there, and the commits API caps a merge commit's file list at 300 entries), and the changed-files fetch fails closed in merge-queue runs so a GitHub API failure cannot silently skip the check. Incident: ClickHouse#108548 Follow-up fix it required: ClickHouse#110260 Co-Authored-By: Claude Fable 5 <[email protected]>
…_materialize_statistics_on_insert Randomize materialize_statistics_on_insert in clickhouse-test
A PR's green CI describes the master of its last run, not of its merge. PR ClickHouse#108548 merged on 2026-07-13 with CI last run on 07-01; on 07-03 master merged ClickHouse#108511, which added materialize_statistics_on_insert to the settings randomizer in tests/clickhouse-test. The PR's new test 02346_text_index_bug108519_qcc_skip_index then failed on master whenever the randomized setting was drawn (~40% of runs) and kept master red for ~7 hours until ClickHouse#110260 pinned auto_statistics_types at the table level. The merge queue already builds the exact merged state (Build (amd_binary)) but ran no stateless tests on it. Add "Stateless tests (amd_binary, flaky check)" to MergeQueueCI: it reruns the PR's new/changed stateless tests on the merge group state (the PR merged with the current master), so a semantic conflict with post-CI master changes bounces the PR from the queue instead of breaking master. The job self-skips when the PR changes no tests. Merge-queue runs use a reduced budget (20 iterations / 20 min instead of 50 iterations / 45 min): the PR CI already ran the full flaky check, and a randomized setting drawn with probability 0.4 per run escapes 20 iterations with probability 0.6^20 ~= 4e-5. Changed-file detection in merge-queue runs now uses the linked PR's paginated files list (PR_NUMBER is 0 there, and the commits API caps a merge commit's file list at 300 entries), and the changed-files fetch fails closed in merge-queue runs so a GitHub API failure cannot silently skip the check. Incident: ClickHouse#108548 Follow-up fix it required: ClickHouse#110260 Co-Authored-By: Claude Fable 5 <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Version info
26.7.1.495(included in26.7and later)