diff --git a/src/Storages/StorageReplicatedMergeTree.cpp b/src/Storages/StorageReplicatedMergeTree.cpp index 793fd02c656..19ae72feb97 100644 --- a/src/Storages/StorageReplicatedMergeTree.cpp +++ b/src/Storages/StorageReplicatedMergeTree.cpp @@ -8180,6 +8180,9 @@ void StorageReplicatedMergeTree::replacePartitionFrom( ++idx; } + /// Force execution of inserted log entries, because it could be delayed at BackgroundPool. + background_operations_assignee.trigger(); + for (const auto & entry : entries) waitForLogEntryToBeProcessedIfNecessary(*entry, query_context); } @@ -8720,6 +8723,9 @@ void StorageReplicatedMergeTree::movePartitionToTable(const StoragePtr & dest_ta parts_holder.clear(); cleanup_thread.wakeup(); + /// Force execution of inserted log entries, because it could be delayed at BackgroundPool. + background_operations_assignee.trigger(); + waitForLogEntryToBeProcessedIfNecessary(entry_delete, query_context); /// Cleaning possibly stored information about parts from /quorum/last_part node in ZooKeeper.