Repository navigation
Add always_fetch_mutated_part setting - #113020
alexey-milovidov merged 17 commits into
Conversation
|
Workflow [PR], commit [808ae47] Summary: ✅
AI ReviewSummaryThis PR adds the Final Verdict✅ No remaining review findings on the current PR head. LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 75/76 (98.68%) · Uncovered code |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction. Compile time of recompiled translation units49 translation units recompiled, 544 s compile time in total, 49 of them have a recent master baseline. |
…th always_fetch_mutated_part When `always_fetch_mutated_part` is enabled, the replica went to `executeFetch` with `need_to_check_missing_part_in_fetch = true`, although no replica can have `entry.new_part_name` until some replica finishes the mutation. The first attempt therefore threw `NO_REPLICA_HAS_PART`, which was recorded as `latest_fail_reason` in `system.mutations`, and `ALTER ... SETTINGS mutations_sync = 1/2` issued on the fetch-only replica could fail for long-running mutations even while another replica was mutating the part successfully. Pass `need_to_check_missing_part_in_fetch = false` instead, so `executeFetch` quietly returns and the entry is retried later (the same pattern as waiting for another replica to produce a recompressed part), and add an integration test that holds the mutation on the executing replica and checks that the fetch-only replica does not record `NO_REPLICA_HAS_PART` while waiting. Co-Authored-By: Claude Fable 5 <[email protected]>
Fetch retries on the fetch-only replica are paced by the background task backoff, so the default 20 seconds may be tight on slow CI runners. Co-Authored-By: Claude Fable 5 <[email protected]>
…he test The `MutateFromLogEntryTask` logger name contains the table UUID, not the table name, so the log-line wait never matched. Co-Authored-By: Claude Fable 5 <[email protected]>
|
🕵 Addressed the AI-review blocker: with Also added an integration test that holds the mutation on the executing replica with The two stress-test failures are unrelated to this PR: "Logical error: ColumnBLOB should be converted to a regular column before usage" is tracked in #113165, and "Logical error: Join is supported only for pipelines with one output port" has a fix in progress in #109393. |
…T` entries The setting short-circuits only `MUTATE_PART` replication log entries. Patch parts created by lightweight updates are applied during merges by `MergeTask`, which is governed by `always_fetch_merged_part` instead, so narrow the documented contract accordingly. Co-Authored-By: Claude Fable 5 <[email protected]>
|
🕵 The Also addressed the AI-review note by narrowing the setting's documented contract to |
…a part Addressed the AI-review finding: with `always_fetch_mutated_part` enabled, `MutateFromLogEntryTask::prepare` returns a non-throwing fetch result while no replica has produced the mutated part yet. Because no exception is thrown, `ReplicatedMergeTreeQueue` does not arm its exponential backoff (it is armed by `updateLastExeption`), and `ReplicatedMergeMutateTaskBase::onCompleted` used to pass `state != SUCCESS` down the immediate `trigger` path, so the same `MUTATE_PART` entry could be re-scheduled in a tight loop (with the corresponding Keeper requests from `executeFetch`) while another replica was still mutating the part. Add an explicit `postpone_next_attempt` flag to `PrepareResult`; when it is set, `onCompleted` asks the background assignee to `postpone` the next attempt instead of triggering it right away.
…serve remote failures With `always_fetch_mutated_part` enabled, the replica does not execute `MUTATE_PART` entries, and per-replica mutation failure status (`latest_fail_reason`) is not replicated, so a `mutations_sync` wait issued on such a replica cannot observe mutation failures happening on the executing replicas. Document this in the setting docstring and log a warning in `waitMutationToFinishOnReplicas`, which relies on local execution for error detection. Addresses the AI review finding in ClickHouse#113020
|
🕵 CI triage for commit 69ed4c3 — all three failures are unrelated to this PR:
Also pushed 696a456 addressing the AI review finding: the setting docstring now documents that |
A replica with the `always_fetch_mutated_part` setting enabled does not execute mutations, and per-replica mutation failure status is not replicated, so `waitMutationToFinishOnReplicas` cannot observe mutation failures that happen on the replicas executing the mutation and would wait until the query is cancelled or the mutation is killed. Fail closed instead of hanging, per the review feedback in ClickHouse#113020: `mutations_sync > 0` is now rejected in `StorageReplicatedMergeTree::mutate` before the mutation entry is created, and `waitMutationToFinishOnReplicas` throws `SUPPORT_IS_DISABLED` (covering `alter_sync > 0` for `ALTER` queries that mutate data) instead of logging a warning. Add a regression test that synchronous mutations and synchronous data-mutating `ALTER`s are rejected on the fetch-only replica while asynchronous application and synchronous mutations issued on an executing replica keep working. Co-Authored-By: Claude Fable 5 <[email protected]>
Adds the
always_fetch_mutated_partsetting for replicatedMergeTreetables. When enabled, the replica fetches parts produced byMUTATE_PARTentries from another active replica instead of executing mutations locally.The behavior is analogous to
always_fetch_merged_part. At least one replica must keep the setting disabled so that mutated parts are produced.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Add the
always_fetch_mutated_partsetting, which allows a replica to download mutated parts from other replicas instead of executing mutations locally.Version info
26.8.1.1036(included in26.8and later)