Repository navigation
Conversation
… drain Before the upgrade, the drain step restarts every replica that shares a Keeper path with a table holding an unfinished mutation, requires it to be writable afterwards, and then waits for the MUTATE_PART entries of the killed mutations to run on the old server. It exists for a leftover entry that clones its source part and then fails the checksum check against another replica that had applied the mutation (ClickHouse#123376). 05259_replace_partition_covers_outdated_parts_replicated creates one replica, stops cleanup, starts a mutation that keeps failing on 1_0_0_0 and drops part 1_1_1_0_2 without a covering part. When the stress runner stops the script right after the DROP PART (an injected memory fault), the table survives with 1_1_1_0 and 1_1_1_0_2 on disk but not in Keeper. The drain's own SYSTEM RESTART REPLICA reloads the parts from disk, the attach thread finds 2 of 3 rows in parts Keeper does not have and leaves the replica read-only with TOO_MANY_UNEXPECTED_DATA_PARTS. The writability check (Code 395) and SYSTEM SYNC REPLICA PULL (Code 242) then fail, and the row "Cannot run the mutation entries left behind by the killed mutations" is red on PRs that do not touch any of this. A leftover entry can only mismatch another replica's part: checkPartChecksumsAndAddCommitOps compares the new part with the same part of the other replicas in <zookeeper_path>/replicas. With a single replica the entry clones the part unchanged on either server and logs a warning at most, so the drain has nothing to do there. Restrict it to tables that Keeper lists with more than one replica (total_replicas != 1) in the listing, the wait count and the dump of undrained entries. total_replicas is 0 when the Keeper read fails, so an unknown case stays in the drain as before, and it counts Keeper replicas, not local ones, so a replica whose sibling is detached stays in. The wait and the dump read total_replicas only for tables that still hold a MUTATE_PART entry: system.replicas applies the inner IN before it issues Keeper status requests. Validated on a local server running the previous release, 26.10.8.34 (the version of the failing runs), with the step extracted from the script: the base script reproduces both CI errors and the Code 231 on the 05259 state; the patched one leaves that table alone and writable, still restarts and drains a two-replica table, does not wait on a blocked single-replica entry, and its polls request no status for 200 idle replicated tables. Failed runs: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=130655&sha=b50f2e6cdf7f666b029f0e029f22107a64c9e175&name_0=PR&name_1=Upgrade%20check%20%28amd_release%29 https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=132154&sha=2ae3d75339eacf467c9ec8c828b76bb4dfbb5e2b&name_0=PR&name_1=Upgrade%20check%20%28amd_release%29 https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=129641&sha=a0cafd06957beae685b0a9ee15eb324cb560a671&name_0=PR&name_1=Upgrade%20check%20%28amd_release%29 Related: ClickHouse#123376, ClickHouse#127843 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-10:20261120-205401 |
|
cc @maxknv, could you review this? The Upgrade check drain of killed-mutation entries now skips tables Keeper lists with a single replica: their leftover MUTATE_PART cannot mismatch another replica, and restarting the 05259 fixture's single replica turns it read-only (TOO_MANY_UNEXPECTED_DATA_PARTS), which failed the step on 3 unrelated PRs. |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-41:20261120-195600 |
|
Workflow [PR], commit [d5f610a] Summary: ✅ AI ReviewSummaryThe PR excludes tables with exactly one Keeper replica from the pre-upgrade killed-mutation drain, consistently updating replica selection, polling, and diagnostics. This avoids restarting interrupted single-replica fixtures while retaining the drain for multiple replicas and unknown replica counts. No actionable findings at Missing context / blind spots
Final VerdictStatus: ✅ Approve |
Related: #123376
Related: #127843
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Description
Upgrade check (amd_release)failsCannot run the mutation entries left behind by the killed mutationsin 3 runs since 2026-11-15 on unrelated PRs (1, 2, 3), always on one table:The previous release's
05259_replace_partition_covers_outdated_parts_replicatedcreates one replica, stops cleanup, starts a mutation that keeps failing and drops a part without a covering part. Stopped right after theDROP PART(an injected memory fault in run 3), it leaves two parts on disk that Keeper no longer has. The pre-upgrade drain (#123376) restarts every replica of a table with an unfinished mutation; the restart reloads those parts and the replica turns read-only withTOO_MANY_UNEXPECTED_DATA_PARTS.The drain exists for a leftover
MUTATE_PARTthat clones its source part and fails the checksum check against a replica that applied the mutation; with one replica there is nothing to mismatch. This PR addstotal_replicas != 1to the drain's listing, wait count and dump, so a table Keeper lists with one replica is not restarted or waited on. A table whose Keeper read fails (total_replicas = 0) stays in, and the wait and the dump read Keeper only for tables still holding aMUTATE_PARTentry.Validated locally on the previous release 26.10.8.34, running the step extracted from the script: the old script reproduces both errors on the 05259 state; the new one leaves that table writable, still drains a two-replica table, does not wait on a blocked single-replica entry, and its polls request no Keeper status for 200 idle replicated tables.
The same table still turns read-only at the upgrade restart; #127843 handles that log line.
Workflow [PR]
Sync PR [sync-upstream/pr/133320]