diff --git a/src/Storages/StorageReplicatedMergeTree.cpp b/src/Storages/StorageReplicatedMergeTree.cpp index 0485fe687e8..91c004e0883 100644 --- a/src/Storages/StorageReplicatedMergeTree.cpp +++ b/src/Storages/StorageReplicatedMergeTree.cpp @@ -5763,6 +5763,9 @@ void StorageReplicatedMergeTree::alter( while (true) { + if (shutdown_called || partial_shutdown_called) + throw Exception(ErrorCodes::ABORTED, "Cannot assing alter because shutdown called"); + bool pulled_queue = false; std::optional maybe_mutations_version_after_logs_pull; std::map unfinished_mutations; @@ -5770,6 +5773,9 @@ void StorageReplicatedMergeTree::alter( { if (command.isDropSomething()) { + if (shutdown_called || partial_shutdown_called) + throw Exception(ErrorCodes::ABORTED, "Cannot assing alter because shutdown called"); + if (!pulled_queue) { auto [_, mutations_version] = queue.pullLogsToQueue(zookeeper, {}, ReplicatedMergeTreeQueue::SYNC);