Repository navigation
Fix flaky test 05258_query_condition_cache_prewhere_attribution - #125702
Merged
alexey-milovidov merged 1 commit intoOct 15, 2026
Merged
Conversation
The test asserts that the second query of each pair hits the query condition cache entry the first one wrote. Dropping or renaming a MergeTree table without a UUID (Ordinary or Memory database) calls Context::clearCaches(), which clears the server-wide query condition cache, so a parallel test doing that between the two queries flips a `_2` row to `0 0` (entry gone) or `1 0` (partial entry). Seen on PR 124345, where 04628_system_replicas_dots_in_names dropped an Ordinary table while qcc_rf_1 was running. Tag the test no-parallel, as the other tests relying on cross-query cache hits are. The queries and the reference are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
Author
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 0 findings) plus my own cold review of the same tree (1 nit).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-9:20261013-221000 |
Collaborator
Author
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-7:20261013-213600 |
Contributor
|
Workflow [PR], commit [dfbe3ce] Summary: ✅ AI ReviewSummaryPR #125702 adds Final VerdictStatus: ✅ Approve |
alexey-milovidov
approved these changes
Oct 15, 2026
1 task done
This was referenced Oct 15, 2026
opensource-fork-sync Bot
pushed a commit
to cla7aye15I4nd/opensource-ClickHouse__ClickHouse
that referenced
this pull request
Oct 26, 2026
The `cache read` and `cache entries with ties kept` checks rerun queries whose entries earlier queries of the test wrote to the server-wide query condition cache. Dropping or renaming a MergeTree table without a UUID (in an Ordinary or Memory database) calls `Context::clearCaches()`, which also empties that cache. In both CI failures a parallel test did that between the fill and the rerun (04498_database_max_tables on master, 01069_database_memory on ClickHouse#127638), so the rerun missed all 3 parts and printed `cache read 0`. Run the test only in the sequential job flavors, as done for 05258 in ClickHouse#125702. Queries and the reference are unchanged; the Random settings limits line is kept byte-identical. Co-Authored-By: Claude Opus 5.5 <[email protected]>
huldarchen
pushed a commit
to huldarchen/ClickHouse
that referenced
this pull request
Nov 8, 2026
…equentially The cache arm compares SelectedMarks of two identical queries: the first one writes a query condition cache entry for the PREWHERE `and(__topKFilter(s), notEmpty(s))`, the second one must read it and select fewer marks. The query condition cache is server-wide. In the failing `Stateless tests (arm_binary, parallel)` run on PR ClickHouse#129954, the parallel test 05213_timeseries_metric_families_target dropped an inner MergeTree table of a TimeSeries table in an Ordinary database between the two queries. MergeTreeData::dropAllData() calls Context::clearCaches() for a table without a UUID, which also clears the query condition cache, so the second query read all 100 marks again and the arm printed 0 instead of 1. Tag the test no-parallel, like 05316 (ClickHouse#125152) and 05258 (ClickHouse#125702), which failed the same way. Co-Authored-By: Claude Opus 5.5 <[email protected]>
thevar1able
pushed a commit
to actueleai/ClickHouse
that referenced
this pull request
Nov 24, 2026
…qcc-no-parallel" This reverts commit 61a00a8, reversing changes made to ce42026. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #122380
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix flaky test
05258_query_condition_cache_prewhere_attribution.Description
05258_query_condition_cache_prewhere_attributionasserts that the second query of each pair hits the query condition cache entry the first one wrote. In parallel stateless jobs one_2row sometimes flips from1 1to0 0or1 0, for example this run.Dropping or renaming a MergeTree table that has no UUID (a table in an
OrdinaryorMemorydatabase) callsContext::clearCaches(), which also clears the server-wide query condition cache. When a parallel test does that between the two queries of a pair, the second query finds no entry (0 0) or a partial one (1 0). In the run above,04628_system_replicas_dots_in_namesdropped anOrdinarytable whileqcc_rf_1was running.The test is now
no-parallel, like the other tests that rely on query condition cache hits across queries. Its queries and.referenceare unchanged.Validation, local debug build: dropping a table in an
Ordinarydatabase empties the cache (2 -> 0 entries, Atomic: 2 -> 2). The unmodified test fails 3/20 with the CI signature while another client creates and drops tables in anOrdinarydatabase, and passes 20/20 without it. The tagged test runs in the sequential group and passes 50/50 with randomized settings, plus 10/10 each with the AsyncInsert and ParallelReplicas profiles.The query condition cache clear in
Context::clearCaches()looks redundant, since the cache never stores entries of tables without a UUID, but removing it is a product change and is not part of this PR.Workflow [PR]
Sync PR [sync-upstream/pr/125702]
Version info
26.10.1.2444-master(included in26.10and later)