Repository navigation
Keep the ProfileEvents-checked reads of the columns cache tests off parallel replicas - #124528
Conversation
…arallel replicas The ParallelReplicas lane enables parallel replicas for every query, so a remote replica on the same server may read all marks of a measured read. Its ColumnsCacheHits/ColumnsCacheMisses then land on its own query_log row (current_database = 'default'), and the initiator row that the test checks has no cache events, which shows up as a `0 0` row. In the failing job's query_log artifact an initiator row has no cache events exactly when its ParallelReplicasReadMarks is 0 (231 of 231 rows of 04064). Run the measured reads with enable_parallel_replicas = 0: in the SETTINGS of each measured read where those are a minority of the test's reads (04064, 04074, 05136, 05060), and as a session SET where nearly every read is measured (05216, 05215, 05230, 04068, 04339). The other reads keep running under parallel replicas. In 05060 the comment avoids the word `query_log`, because the client sends leading comments as part of the query text and the oracle filters on `query NOT LIKE '%query_log%'`. Measured on a local ParallelReplicas rig with one binary: unmodified tests fail 169/180 runs (no failpoint) and 45/45 with parallel_replicas_local_plan = 0; the fixed tests pass 270/270 and 90/90, and 450/450 without parallel replicas. Removing the pin from one read of 04064 fails exactly that line. 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; 1 finding).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20261008-003400 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-7:20261007-232100 |
|
Workflow [PR], commit [ae022b8] Summary: ✅ AI ReviewSummaryThis PR makes the columns-cache tests that read Final Verdict
|
…off parallel replicas 04070, 04072, 05029, 05055, 05155 and 05210 assert `ColumnsCacheHits`/`ColumnsCacheMisses` from the initiator's `system.query_log` row, the same oracle as the nine tests fixed in the previous commit. They have not failed in the `ParallelReplicas` lane yet, but they carry the same precondition: when a remote replica reads all marks of a measured read, the initiator row has no cache events. With `parallel_replicas_local_plan = 0` on a local `ParallelReplicas` rig the unmodified tests fail 18/18 with exactly that shape, and pass 55/55 with the pin. The pinned runs have no secondary replica query for any measured read. In all six tests the measured reads depend on the cache state left by the reads before them, so the pin covers the whole test: a session `SET`, and for the shell test 04072 the client option, which keeps it apart from the lines changed by ClickHouse#123949. Also quote the setting and table names in the comments of the pins, as the in-tree style asks. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…arallel replicas In the ParallelReplicas configuration the coordinator hands mark ranges to whichever replica asks first, so a remote replica sometimes reads every mark of the measured query. That replica counts StringValueFilterValuesChecked/Replaced/BytesSkipped on its own query_log row (is_initial_query = 0, current_database = 'default'), which the tests' current_database = currentDatabase() filter drops, so the checked row reads 0. Seen in the failing jobs' own query_log: every initiator row with 0 had a secondary row carrying the events (e.g. 0/0 on the initiator, 100000/99000 on the secondary). Run exactly the measured reads with enable_parallel_replicas = 0, as ClickHouse#124528 did for the columns cache tests. The other reads of these tests keep running under parallel replicas in that configuration. 05325 asserts 0 and cannot fail this way, but a remote read made it pass whatever the guard does, so it is pinned too. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…lesystem_cache` off parallel replicas In the `ParallelReplicas` CI configuration every query runs with parallel replicas, and the coordinator hands the marks to whichever replica asks first. When the remote replicas read all of them, the cache, file descriptor and throttler `ProfileEvents` land on their own `query_log` rows (`is_initial_query = 0`, `current_database = 'default'`), which the test's `current_database = currentDatabase()` filter drops, so the initiator row shows `CachedReadBufferReadFromCacheBytes = 0` and the throttler check compares `0 <= 0`. Observed in the failing job's `query_log` (PR ClickHouse#124753, arm_binary ParallelReplicas): the initiator read 0 marks, the two remote rows read 1 + 28 marks with 12268 + 1409476 cache bytes. Pin `enable_parallel_replicas = 0` on the measured read only, as ClickHouse#124528 did for the columns cache tests, so both columns are evaluated on the row that did the read. The warm-up read is unchanged: the replicas are the same server process and warm the same filesystem cache. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Related: #123790
Related: #124015
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Nine columns cache tests assert
ProfileEvents['ColumnsCacheHits'/'ColumnsCacheMisses']fromsystem.query_logand fail in theParallelReplicaslane with a0 0row, e.g.04064_columns_cache_metricson #123790: report. In the coverage lane the failures are relabeledOK, so they are hidden there: in 30 days 05216 408, 04064 400, 05136 246, 05215 174, 05060 124, 05230 26, 04068 23, 04339 8, 04074 8 failures (~1470 runs each, incl. master). Once #123790 merges they become visible on every PR.The lane enables parallel replicas for every query, so a remote replica on the same server may read all marks of a measured read. Its ProfileEvents land on its own
query_logrow (current_database = 'default'), not on the initiator's row, which the test reads and which then has no cache events. The failing job'squery_logartifact confirms it: an initiator row has no cache events exactly when itsParallelReplicasReadMarksis 0.The change runs the measured reads with
enable_parallel_replicas = 0: per query in 04064, 04074, 05136 and 05060, whose other reads keep running under parallel replicas; for the whole test in the other eleven (a sessionSET, or the client option in the shell test 04072). No reference changes. Six of them (04070, 04072, 05029, 05055, 05155, 05210) have not failed in that lane yet but carry the same precondition. The other columns cache tests with this oracle (05043, 05154, 05213, 05214) are already taggedno-parallel-replicas.Validation on a local
ParallelReplicasrig, same binary: withparallel_replicas_local_plan = 0the unmodified tests fail 63/63 and the fixed ones pass 145/145; without it the unmodified nine fail 169/180 and all fixed tests pass 363/363. The fixed tests also pass with parallel replicas off.Workflow [PR]
Sync PR [sync-upstream/pr/124528]
Version info
26.10.1.1882-master(included in26.10and later)