Fix LOGICAL_ERROR in TemporaryParts::add during mutation checksum mismatch fallback#96376
Merged
alexey-milovidov merged 1 commit intomasterfrom Feb 8, 2026
Merged
Conversation
…ismatch fallback When a mutation produces a part that is not byte-identical to another replica, `MutateFromLogEntryTask::finalize` falls back to fetching the part. If the mutation did not touch any rows, `MutateTask` clones the source part using `cloneAndLoadDataPart` with the `tmp_clone_` prefix, which registers the temporary part name in `TemporaryParts`. The fallback fetch in `fetchPart` also tries to clone with the same `tmp_clone_` prefix, hitting `TemporaryParts::add` with a duplicate name and causing a `LOGICAL_ERROR` exception that aborts the server. The fix resets `mutate_task` before `checkPartChecksumsAndCommit`, releasing the RAII guard for the temporary directory. This mirrors the existing pattern in `MergeFromLogEntryTask::finalize`, which already resets `merge_task` at the same point for the same reason. https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=96319&sha=6758cc8debe3136c3c71c9cc044d00daa0042a43&name_0=PR&name_1=Stateless%20tests%20%28amd_binary%2C%20old%20analyzer%2C%20s3%20storage%2C%20DatabaseReplicated%2C%20sequential%29 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Contributor
1 task
Member
|
Fix is correct, but need followup #99613. |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a mutation produces a part that is not byte-identical to another replica,
MutateFromLogEntryTask::finalizefalls back to fetching the part. If the mutation did not touch any rows,MutateTaskclones the source part usingcloneAndLoadDataPartwith thetmp_clone_prefix, which registers the temporary part name inTemporaryParts. The fallback fetch infetchPartalso tries to clone with the sametmp_clone_prefix, hittingTemporaryParts::addwith a duplicate name and causing aLOGICAL_ERRORexception that aborts the server.The fix resets
mutate_taskbeforecheckPartChecksumsAndCommit, releasing the RAII guard for the temporary directory. This mirrors the existing pattern inMergeFromLogEntryTask::finalize, which already resetsmerge_taskat the same point for the same reason.https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=96319&sha=6758cc8debe3136c3c71c9cc044d00daa0042a43&name_0=PR&name_1=Stateless%20tests%20%28amd_binary%2C%20old%20analyzer%2C%20s3%20storage%2C%20DatabaseReplicated%2C%20sequential%29
Closes #86050.
Changelog category (leave one):