Repository navigation
Fix flaky test 05507_autopr_direct_read_from_text_index - #132192
Conversation
The first query (automatic_parallel_replicas_mode = 2) collects the statistics on its read and, through its PREWHERE hasToken(str, 'rare'), fills the server-wide query condition cache with the marks that hold no 'rare' row. With text_index_posting_list_codec = 'none', a posting list block size of 16 or 64 and a small index_granularity, the text index analysis keeps only per-block row ranges for 'rare', so it is coarser than the filter, and the cache prunes the index analysis of the second query (mode 1) from 669 to 100 marks. The drift check then sees 14800 rows instead of the 99012 the statistics were collected on, recollects the statistics and keeps the single-node plan, so the test reads 0 0 instead of 1 1. Disable the query condition cache in the test, as 05565_autopr_statistics_drift_ratio and 05100_autopr_skip_index_on_data_read do. A Random settings limits clamp cannot work: the cache is on by default. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 0 findings) plus my own review (0 findings). Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-9:20261117-012600 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-41:20261117-010900 |
|
Workflow [PR], commit [cb6ffb7] Summary: ✅ AI ReviewSummaryDisables Final Verdict✅ Approve |
d2ff9fb
Related: #129339
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
05507_autopr_direct_read_from_text_index(added in #129339) failed 4 times in 30 days, always on reference line 8 (1 1->0 0: the05507_appliedquery did not apply automatic parallel replicas), e.g. inStateless tests (arm_binary, ParallelReplicas, s3 storage, parallel)andStateless tests (amd_debug, distributed plan, s3 storage, parallel). The runner's own diagnosis blames random MergeTree settings:text_index_posting_list_codec = 'none'with a posting list block size of 16 or 64 and a smallindex_granularity.The first query (mode 2) collects the statistics on 669 marks and, through its PREWHERE
hasToken(str, 'rare'), fills the server-wide query condition cache. With those settings the text index analysis is coarser than the filter, so the cache prunes the second query (mode 1) to 100 marks. The job's server log showsSignificant difference in total rows from storage detected ... (previously 99012, now 14800). Recollecting statistics, and mode 1 keeps the single-node plan. The engine is right to recollect; the test depended on the cache.The test now sets
use_query_condition_cache = 0, as05565_autopr_statistics_drift_ratioand05100_autopr_skip_index_on_data_readdo. ARandom settings limitsclamp would not help: the cache is on by default.Validation (debug build, with the CI
users.d/limits.yamlprofile): with--index_granularity 148 --text_index_posting_list_block_size 64 --text_index_posting_list_codec noneand no other random settings, the unchanged test fails 5/5 with the CI diff and passes 5/5 with the fix. With those MergeTree settings plus random settings it failed 24/50 before and 0/50 after; 50/50 OK with default randomization.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/132192]
Version info
26.11.1.2749-master(included in26.11and later)