Fix background moves start

This commit is contained in:
alesapin 2020-10-20 14:27:50 +03:00
parent d126aa8a09
commit ce8ee01d75
2 changed files with 6 additions and 7 deletions

View File

@ -108,8 +108,7 @@ void StorageMergeTree::startup()
try try
{ {
background_executor.start(); background_executor.start();
if (areBackgroundMovesNeeded()) startBackgroundMovesIfNeeded();
background_moves_executor.start();
} }
catch (...) catch (...)
{ {
@ -1465,6 +1464,7 @@ MutationCommands StorageMergeTree::getFirtsAlterMutationCommandsForPart(const Da
void StorageMergeTree::startBackgroundMovesIfNeeded() void StorageMergeTree::startBackgroundMovesIfNeeded()
{ {
if (areBackgroundMovesNeeded())
background_moves_executor.start(); background_moves_executor.start();
} }

View File

@ -3483,9 +3483,7 @@ void StorageReplicatedMergeTree::startup()
/// If we don't separate create/start steps, race condition will happen /// If we don't separate create/start steps, race condition will happen
/// between the assignment of queue_task_handle and queueTask that use the queue_task_handle. /// between the assignment of queue_task_handle and queueTask that use the queue_task_handle.
background_executor.start(); background_executor.start();
if (areBackgroundMovesNeeded()) startBackgroundMovesIfNeeded();
background_moves_executor.start();
} }
catch (...) catch (...)
{ {
@ -5984,6 +5982,7 @@ MutationCommands StorageReplicatedMergeTree::getFirtsAlterMutationCommandsForPar
void StorageReplicatedMergeTree::startBackgroundMovesIfNeeded() void StorageReplicatedMergeTree::startBackgroundMovesIfNeeded()
{ {
if (areBackgroundMovesNeeded())
background_moves_executor.start(); background_moves_executor.start();
} }