Repository navigation
Fix flaky test 05332_autopr_min_bytes_per_replica_events - #126189
alexey-milovidov merged 1 commit into
Conversation
The first query (`skipped_early`) runs `PREWHERE flag = 1` and fills the server-wide query condition cache, so the `collect` run selects 1 of 782 granules and AutoPR stores statistics with 128 rows to read. If a parallel test drops a table of an `Ordinary` database in between, the table has no UUID, so `MergeTreeData::dropAllData()` calls `Context::clearCaches()`, which clears every global cache including the query condition cache. The `rejected` run then selects all 100000 rows, the drift check sees 128 vs 100000 and recollects statistics instead of deciding, so it reports a probe plan built and no `RejectedByThreshold`. Seen in the failing CI job: the neighbour `05060_database_max_tables_rename_inner_tables` dropped a UUID-less table between the two runs, and the server logged "Significant difference in total rows from storage detected ... (previously 128, now 100000)". Disable the query condition cache in the test body. All three queries then select the same granules whatever runs in parallel, and the early estimate is the full `payload` column, which is the path the test's comments describe. A `Random settings limits` clamp is not enough: the setting defaults to true and jobs that run with `--no-random-settings` (Fast test, azure, coverage, Bugfix validation) would keep the cache on. 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; 1 finding) plus my own review (1 nit).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20261016-031000 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-41:20261016-024900 |
|
Workflow [PR], commit [9562705] Summary: ✅ AI ReviewSummaryThe change sets Missing context / blind spots
Final VerdictStatus: ✅ Approve. |
|
cc @nickitat, could you review this? The test relied on the server-wide query condition cache staying filled between the |
a87ecfb
Related: #120884
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
05332_autopr_min_bytes_per_replica_events(added in #120884) failed inStateless tests (amd_debug, parallel)on PR #125846: therejectedrun built a probe plan again and never reachedRejectedByThreshold. 133 reruns with the same settings passed.The first query (
PREWHERE flag = 1) fills the server-wide query condition cache, so thecollectrun selects 1 of 782 granules and AutoPR stores 128 rows to read. Betweencollectandrejected, the parallel test05060_database_max_tables_rename_inner_tablesdropped a table of anOrdinarydatabase. That table has no UUID, soMergeTreeData::dropAllDatacallsContext::clearCaches, which clears the query condition cache too.rejectedthen selected all 100000 rows, and the job's server log showsSignificant difference in total rows from storage detected ... (previously 128, now 100000). Recollecting statistics. The engine is right to recollect. The test depended on a cache that other tests clear.The test now sets
use_query_condition_cache = 0, as other AutoPR tests do (e.g.03800_autopr_reuse_index_analysis). ARandom settings limitsclamp would not help: the cache is on by default, and jobs that run without random settings would keep it.Validation (debug build):
SYSTEM CLEAR QUERY CONDITION CACHE, or anOrdinarytable drop, between the two runs: 5/5 fail per trigger with the CI diff. With the fix: 3/3 pass per trigger.Ordinarytable drops: 40/50 failed before the fix, 0/50 after.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/126189]
Version info
26.11.1.106-master(included in26.11and later)