diff --git a/src/Storages/StorageReplicatedMergeTree.cpp b/src/Storages/StorageReplicatedMergeTree.cpp index c0ae46552ec..f65fad32f5b 100644 --- a/src/Storages/StorageReplicatedMergeTree.cpp +++ b/src/Storages/StorageReplicatedMergeTree.cpp @@ -4902,7 +4902,9 @@ bool StorageReplicatedMergeTree::getFakePartCoveringAllPartsInPartition(const St auto zookeeper = getZooKeeper(); delimiting_block_lock = allocateBlockNumber(partition_id, zookeeper); right = delimiting_block_lock->getNumber(); - mutation_version = queue.getCurrentMutationVersion(partition_id, right); + // Make sure we cover all parts in partition. In rare cases there might be parts with + // mutation version greater than current block number. + mutation_version = MergeTreePartInfo::MAX_BLOCK_NUMBER; } if (for_replace_range)