Repository navigation
Fix flaky test 05367_text_index_embedded_positions under parallel replicas - #129610
Conversation
…licas The last query read TextIndexPositionsBlocksRead/BytesRead only from the initiator's query_log row (current_database = currentDatabase()). The counters are incremented by the replica that reads the granule. In the ParallelReplicas configuration the merged part has a single mark, and a remote replica sometimes reads it; that replica's QueryFinish row has current_database = 'default' and is_initial_query = 0, so the initiator row showed 0 (3 of ~580 runs of the arm_binary ParallelReplicas check). Sum the counters over every QueryFinish row that shares the initiator's initial_query_id, as 05232_text_index_lazy_intersection_block_span_rule does. A replica logs QueryFinish before it sends EndOfStream, so SYSTEM FLUSH LOGS makes every replica row visible. The tested queries and the reference are unchanged. 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 (2 nits, no code change).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20261105-200200 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-4:20261105-191600 |
|
Workflow [PR], commit [9adab12] Summary: ✅ AI ReviewSummaryThe PR fixes the flaky Final VerdictStatus: ✅ Approve. |
|
cc @ahmadov, could you review this and add the |
a903fa7
Related: #125630
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not required.
Description
Failure:
Stateless tests (arm_binary, ParallelReplicas, s3 storage, parallel)on master7833893d3bb6: the last block printed05367_embedded 0 0instead of1 0. It failed 4 times in about 650 runs of that check since the test was added in #125630, and nowhere else.The last query read
TextIndexPositionsBlocksReadandTextIndexPositionsBytesReadonly from the initiator'squery_logrow (current_database = currentDatabase()). These counters are incremented on the replica that reads the granule. In the ParallelReplicas configuration the merged part has one mark, and sometimes a remote replica reads it; that replica's row hascurrent_database = 'default', so the initiator row shows 0. The failing job's ownquery_logshows the initiator row withParallelReplicasReadMarks = 0and a secondary row of the sameinitial_query_idwithParallelReplicasReadMarks = 1andTextIndexPositionsBlocksRead = 2; their sum is the reference value.The query now sums both counters over every
QueryFinishrow that shares the initiator'sinitial_query_id, as05232_text_index_lazy_intersection_block_span_ruledoes. The tested queries and the reference are unchanged, so the test keeps its parallel replicas coverage.Validation (master debug build, local copy of the ParallelReplicas configuration with three replicas):
parallel_replicas_local_plan = 0: old 20/20 fail, new 20/20 pass; keeping only initiator rows in the new query fails 20/20.slowdown_parallel_replicas_local_plan_read: the old test fails in exactly the 52 of 80 randomized runs where a remote replica read the mark, the new one passes 80/80 with 43 such runs; with the failpoint around only the05367_embeddedquery the old test prints the CI diff, 20/20.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/129610]
Version info
26.11.1.1480-master(included in26.11and later)