Fix MATERIALIZE INDEX/PROJECTION mutation stuck after DROP#98369
Merged
alexey-milovidov merged 2 commits intomasterfrom Mar 1, 2026
Merged
Fix MATERIALIZE INDEX/PROJECTION mutation stuck after DROP#98369alexey-milovidov merged 2 commits intomasterfrom
alexey-milovidov merged 2 commits intomasterfrom
Conversation
…n is dropped `MATERIALIZE INDEX` and `MATERIALIZE PROJECTION` mutations could get stuck with "Unknown index" or "No such projection" exceptions if the index or projection was dropped before the mutation finished executing. This can happen in replicated environments or after `KILL MUTATION` followed by `DROP INDEX`/`DROP PROJECTION`. The fix makes `MutationsInterpreter::prepare` gracefully skip materialization when the target index or projection no longer exists in the metadata, instead of throwing an exception. Closes #38643 ### Changelog category: - Bug Fix (user-visible misbehavior in an official stable release) ### Changelog entry: Fix `MATERIALIZE INDEX` and `MATERIALIZE PROJECTION` mutations getting stuck when the index or projection is dropped before the mutation finishes. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Contributor
alexey-milovidov
commented
Mar 1, 2026
Member
Author
alexey-milovidov
left a comment
There was a problem hiding this comment.
This looks alright.
Contributor
|
Hi — this PR may need backporting to release branches Why: This fixes stuck mutations (issue #38643 from 2022) in MutationsInterpreter, which is core MergeTree code present in all stable branches. The bug affects both replicated and non-replicated tables and can block mutation progress indefinitely. If this should be backported, consider adding |
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.
Summary
MATERIALIZE INDEXandMATERIALIZE PROJECTIONmutations getting stuck with "Unknown index" / "No such projection" exceptions when the index or projection is dropped before the mutation finishes executingKILL MUTATIONfollowed byDROP INDEX/DROP PROJECTIONMutationsInterpreter::preparegracefully skip materialization when the target no longer exists, instead of throwingCloses #38643
Changelog category:
Changelog entry:
Fix
MATERIALIZE INDEXandMATERIALIZE PROJECTIONmutations getting stuck when the index or projection is dropped before the mutation finishes.🤖 Generated with Claude Code