Repository navigation
Fix flaky test 05218_text_index_substreams_opened_lazily - #123823
alexey-milovidov merged 2 commits into
Conversation
The FileOpen thresholds of 05218_text_index_substreams_opened_lazily assume that the mark cache and the text index header, tokens and postings caches are still warm when the measured query runs after its unmeasured warm-up. They are server-global: a concurrent test that drops or renames a MergeTree table in a database without table UUIDs (Ordinary, Memory) goes through MergeTreeData::dropAllData() / rename(), which call Context::clearCaches() and empty all of them. The measured query then reopens every substream and one threshold flips (8 FAIL in the first hours after the test reached master, 2 of them on master, answers always right). The failing jobs' query_log shows the concurrent DROP TABLE between the warm-up and the measurement, and 30 header, token, postings and mark misses on the measured query. Repeat the warm-up and the measured query, at most 10 times, while the measured query's own MarkCacheMisses, TextIndexHeaderCacheMisses and TextIndexTokensCacheMisses (plus TextIndexPostingsCacheMisses for the postings-cached query) are above zero. Thresholds, fixture and reference are unchanged, and the in-range control is still measured once since a clear only adds opens to it. A real regression opens a substream with warm caches, shows zero misses, stops at attempt 1 and fails as before. Locally, with a loop dropping a MergeTree table in a Memory database every second: old test 13/50 FAIL, new test 0/50. Without interference 50/50, one attempt each. A mutation opening the dictionary substream eagerly fails 5/5 at attempt 1; with a clear every ~15 ms, runs that never got a warm attempt fail. 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 cold review of the diff.
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-10:20261004-042400 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-40:20261004-034800 |
|
Workflow [PR], commit [bc815a6] Summary: ✅ AI ReviewSummaryThis PR fixes the flakiness in Final Verdict
|
|
@groeneai add a |
Per review: drop the `measure_warm` retry helper and tag the test `no-parallel`. The oracle needs the server-global mark cache and text index header/tokens/postings caches to stay warm between the warm-up and the measured query. The only thing that empties them mid-test is a concurrent `DROP` or `RENAME` of a `MergeTree` table in a database without table UUIDs (`MergeTreeData::dropAllData` / `MergeTreeData::rename` -> `Context::clearCaches`), which only another running test can issue. `clickhouse-test` starts the sequential runner after every parallel worker has been reaped, and CI runs the parallel and sequential flavors as separate jobs, so nothing can clear the caches while 05218 runs. Local, randomized settings: 05218 with 03167/05214/05234 (the cache-clearing tests seen in the failing CI jobs), -j 8, --test-runs 10: 05218 ran in the sequential phase after the last clearing query (13:59:02.460 vs first 05218 query at 13:59:02.669), 10/10 OK, every measured query 0 cache misses (selective `FileOpen` 1, postings-cached `FileOpen` 30). 05218 alone, --test-runs 30: 30/30 OK. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks, done in bc815a6: the retry helper is gone and the test is tagged |
Related: #121040
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix flaky test
05218_text_index_substreams_opened_lazily.Description
05218_text_index_substreams_opened_lazily(added in #121040) fails in parallel stateless runs andFast teston master and unrelated PRs, with oneFileOpenthreshold flipped while the answers stay right: 8 FAIL / 485 OK in the first 4 hours after it landed, 2 of them on master (master run).The thresholds assume the server-global mark and text index header / tokens / postings caches stay warm between the unmeasured warm-up and the measured query. A concurrent test that drops a
MergeTreetable in a database without table UUIDs (Ordinary,Memory) goes throughMergeTreeData::dropAllData, which callsContext::clearCachesand empties all of them, so the measured query reopens every substream (in the failing jobs'query_log: 30 header, token, postings and mark misses each,FileOpen90 against the threshold of 45).The test is now tagged
no-parallel. Only another running test can issue such aDROP(orRENAME), andclickhouse-teststarts the sequential runner after all parallel workers have finished; CI runs the sequential flavor as separate jobs. Thresholds, measurements and the reference are unchanged.Validation, local debug build, randomized settings:
-j 8, 10 runs: 05218 ran in the sequential phase after the last clearing query, 10/10 OK, every measured query with 0 cache misses.DROPbetween the warm-up and the measured query flips both thresholds every time, and a loop issuing it every second fails the test 13/50.Workflow [PR]
Sync PR [sync-upstream/pr/123823]
Version info
26.10.1.1525-master(included in26.10and later)