Repository navigation
Tag 05316_top_k_primary_key_skip_query_condition_cache as no-parallel - #125152
Merged
alexey-milovidov merged 1 commit intoOct 11, 2026
Merged
alexey-milovidov merged 1 commit into
alexey-milovidov merged 1 commit into
Conversation
The second read of the test relies on the query condition cache entries written by the first one. The cache is server-wide, and in the parallel phase another test can empty it between the two reads, so the second read reads as many rows as the first and the test prints `1 0`. In both failing CI runs the eraser was a DROP DATABASE / RENAME TABLE of MergeTree tables in an Ordinary database (05060_database_max_tables_rename_inner_tables, 05213_timeseries_metric_families_target): a MergeTree table without a UUID calls Context::clearCaches() on drop and rename, which also clears the query condition cache. An explicit SYSTEM CLEAR QUERY CONDITION CACHE in another parallel test has the same effect. Run the test in the sequential group, like the other tests that check QueryConditionCacheHits. 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 on the code). The independent cold review found 0 code findings; its two wording nits on the PR description were applied before publication. Session id: cron:clickhouse-review-slot-8:20261011-042600 |
Collaborator
Author
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-41:20261011-041400 |
Contributor
|
Workflow [PR], commit [e9c97ba] Summary: ✅ AI ReviewSummaryThis PR moves Final Verdict✅ No findings. |
alexey-milovidov
approved these changes
Oct 11, 2026
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]>
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: #121145
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
05316_top_k_primary_key_skip_query_condition_cachesometimes prints1 0instead of1 1: the repeated read was not made cheaper by the query condition cache (arm_binary, parallel, amd_asan_ubsan, targeted; no failures on master).The second read relies on the cache entries written by the first one, and in the parallel phase another test can empty the server-wide cache in between. In both failing runs the server log shows it happening a few milliseconds after the first read: a
DROP DATABASE(05060_database_max_tables_rename_inner_tables) and aRENAME TABLE(05213_timeseries_metric_families_target) of MergeTree tables in anOrdinarydatabase. A MergeTree table without a UUID callsContext::clearCaches()on drop and rename, which also clears the query condition cache. An explicitSYSTEM CLEAR QUERY CONDITION CACHEin another parallel test has the same effect.The test is now tagged
no-parallel, like the other tests that rely on query condition cache entries surviving between queries (e.g.05320_object_storage_top_k_query_condition_cache_fallback_files). Test-only change, reference unchanged.Validation on a master debug build: putting
SYSTEM CLEAR QUERY CONDITION CACHEor a create and drop of a MergeTree table in anOrdinarydatabase between the two reads gives1 03/3 (with anAtomicdatabase:1 13/3). Running the test 40 times next to 40 runs of05060_database_max_tables_rename_inner_tableswith-j 8fails 3/40 with the CI diff before the change and 0/40 after it, since the runner now puts it in the sequential group. 50/50 randomized runs pass.Workflow [PR]
Sync PR [sync-upstream/pr/125152]
Version info
26.10.1.2142-master(included in26.10and later)