Repository navigation
Fix flaky prewarm mark cache tests with parallel replicas - #124942
alexey-milovidov merged 1 commit into
Conversation
In the ParallelReplicas configuration the single segment of these tests' tables is read by whichever of the three replicas gets it. When a remote replica reads it, the mark and primary index load counters land on that replica's own query_log row (is_initial_query = 0, current_database = 'default'), which the current_database = currentDatabase() filter drops, so the initiator row shows 0. parallel_replicas_local_plan = 1 does not help: the local plan is used but gets nothing to read. Sum the counters over all rows whose initial_query_id is one of the test's queries, as in 02417_load_marks_async (ClickHouse#123825). All replicas share one server's caches and each load is counted once, so the exact references are unchanged, and nothing changes without parallel replicas. Failing job: 03254_system_prewarm_mark_cache in Stateless tests (arm_binary, ParallelReplicas, s3 storage, sequential) on PR ClickHouse#124862. 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 (1 nit).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20261009-152400 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-5:20261009-144600 |
|
Workflow [PR], commit [035559a] Summary: ✅ AI ReviewSummaryThis PR deflakes four prewarm-cache stateless tests under Final Verdict✅ No new review findings. |
In the ParallelReplicas lanes the table's single mark goes to whichever replica asks the in-order coordinator first. When a remote replica wins, the FileOpen/S3GetObject counts land in its own query_log row (is_initial_query = 0, current_database = 'default'), which the `current_database = currentDatabase()` filter drops, so the check read 0 (seen on PR ClickHouse#111166: FileOpen 0 instead of 6). Sum the counter over all rows whose initial_query_id is one of the test's queries, as done for the prewarm mark cache tests in ClickHouse#124942. Replicas without a range open nothing, so the sums are exact and the references are unchanged; without parallel replicas each group is the initiator row alone. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
The tests
03254_system_prewarm_mark_cache,03254_prewarm_mark_cache_rmt,03254_prewarm_mark_cache_columnsand03277_prewarm_cache_2now sum mark and primary index load counters over the initial query and the parallel replicas queries it starts, instead of reading only the initiator'ssystem.query_logrow.Description
Related: #123825 (same fix for
02417_load_marks_async)Related: #104924 (enabled
03254_system_prewarm_mark_cacheunder parallel replicas)03254_system_prewarm_mark_cachefailed inStateless tests (arm_binary, ParallelReplicas, s3 storage, sequential): job,-1 +0forLoadedMarksCount > 0of the first read.In that lane the table's single segment is read by whichever of the three replicas gets it. In the failing job's
query_logthe initiator row has 0 loaded marks, while the remote replica's row (is_initial_query = 0,current_database = 'default') has 24. Remote profile events are not merged into the initiator row, andcurrent_database = currentDatabase()drops the replica rows.parallel_replicas_local_plan = 1, already set in the test, does not help: the local plan is used but gets nothing to read. The post-prewarm row has the same blind spot.The four oracles now sum the counters over all rows whose
initial_query_idis one of the test's queries. All replicas share one server's caches and each load is counted once, so the sums are exact (the exact-value references4and2 1are unchanged), and nothing changes without parallel replicas.Validation on a master debug binary with the lane's 3-replica config:
slowdown_parallel_replicas_local_plan_read, 20 runs per test: old checks 56/80 FAIL, exactly the runs where the initiator loaded nothing; new checks 80/80 OK, 55 of them such runs;parallel_replicas_local_plan = 0: old 30/30 FAIL, new 30/30 OK;SYSTEM PREWARM MARK CACHE, or prewarming before the first read, makes the new check fail 20/20 each.Workflow [PR]
Sync PR [sync-upstream/pr/124942]
Version info
26.10.1.2085-master(included in26.10and later)