From 9dd9c227e511b014ad2dad55d941d639ea756249 Mon Sep 17 00:00:00 2001 From: Aleksei Filatov Date: Mon, 18 Nov 2024 08:57:15 +0000 Subject: [PATCH] Trigger queue extry processing after ALTER TABLE REPLACE/MOVE PARTITION --- src/Storages/StorageReplicatedMergeTree.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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.