Repository navigation
Conversation
…ze sweep Attempt of fix-plan r1: PipelineExecutor::finalizeExecution now calls onProgress when a processor has only pending totals. It delivers the total the parallel replicas coordinator buffered in a source that never runs again (05325_parallel_replicas_progress_total_rows, local_plan=0), but it also delivers the estimates of read-in-order FINAL layer sources that never ran because LIMIT was satisfied, so 05325_read_in_order_final_virtual_row fails with TOO_MANY_ROWS (max_rows_to_read = 3200). Kept only so PLAN can choose the disposition; the test extension is independent of the mechanism. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ouncing replica With `parallel_replicas_local_plan = 0` the coordinator is the only source of the total rows to read. It reported the total through one stored progress callback that every `RemoteSource` overwrote, so the total was buffered in the source of the last replica, whichever replica announced. If that source never ran again (the replica was unavailable, or it was cancelled as unused because another replica took all marks), only the executor's finalize sweep saw the buffered total, and the sweep does not deliver totals-only progress, so the query reported no total (`05325_parallel_replicas_progress_total_rows`, "total_rows_to_read":"0"). The coordinator no longer stores a callback. `RemoteQueryExecutor` passes its own callback into `handleInitialAllRangesAnnouncement`, and the stream coordinators report the total through it. The announcing replica's source is running and its progress is collected after the current `work()`, so the total is always delivered. The initiator's local read passes none and keeps setting the total itself. This also reverts the previous commit's change to the executor's finalize sweep: delivering pending totals there also delivered the estimates of sources that never ran because a LIMIT was reached early, which made `05325_read_in_order_final_virtual_row` fail with TOO_MANY_ROWS. The test gets an arm with an unavailable replica, where the total was lost on every query. 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; plus my own review: 2 nits).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-9:20261028-085900 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-6:20261028-082300 |
|
cc @nickitat @devcrafter, could you review this and add the |
|
Workflow [PR], commit [24d1674] Summary: ✅
AI ReviewSummaryReviewed PR #128036 at Final VerdictStatus: ✅ Approve. No changes requested. |
CI finish ledger - 407e49cEvery failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
All five stateless flaky check builds passed with the extended Session id: cron:our-pr-ci-monitor:20261028-183003 |
…ss-total-rows # Conflicts: # src/Storages/MergeTree/ParallelReplicasReadingCoordinator.h
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units130 translation units recompiled, 2094 s compile time in total, 130 of them have a recent master baseline. |
Related: #127673
Related: #123928
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
With parallel replicas and
parallel_replicas_local_plan = 0, query progress (for exampleX-ClickHouse-Summary) now always contains the total number of rows to read, also when some replicas are unavailable or receive no work.Description
05325_parallel_replicas_progress_total_rowsprinted"read_rows":"1000000" "total_rows_to_read":"0"for itsparallel_replicas_local_plan=0arm in Stateless tests (amd_debug, parallel) on #127673 (requested there).Without a local plan, the total comes only from the coordinator, which reported it through one stored progress callback. Every
RemoteSourceoverwrote that callback, so it was always the last replica's, whichever replica announced. The total was buffered in that source and was lost when the source never ran again: in the CI log one replica took all marks and the other two were cancelled as unused right afterTotal rows to read: 1000000. With an unavailable last replica it is lost on every query.The coordinator no longer stores a callback.
RemoteQueryExecutorpasses its own callback intohandleInitialAllRangesAnnouncement, so the total is reported through the replica that announced, whose source is running and whose progress is collected right after. The initiator's local read passes none, as before.The test gets an arm on
test_cluster_1_shard_3_replicas_1_unavailable(no existing line changed).Validation (debug build): with the unavailable replica, master reports 0 on 100/100 queries for both the count and the read-in-order arm, the fix 1000000 on 100/100. The extended test fails 50/50 on master and passes 50/50 with the fix (also with
-j 8). In the CI shape (3 local replicas, 16 concurrent queries) master lost the total 3/3200, the fix 0/3200. The parallel-replicas, progress and read-limit tests show no failure with the fix that does not also occur on master in the same local setup.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/128036]