Revert "fix race with check thread"

This reverts commit 45284108ba.
This commit is contained in:
Alexander Tokmakov 2022-08-16 12:49:17 +02:00
parent b3f3b60ac3
commit d4fb75c8db

View File

@ -151,13 +151,13 @@ bool ReplicatedMergeTreeRestartingThread::runImpl()
setNotReadonly(); setNotReadonly();
/// Start queue processing /// Start queue processing
storage.part_check_thread.start();
storage.background_operations_assignee.start(); storage.background_operations_assignee.start();
storage.queue_updating_task->activateAndSchedule(); storage.queue_updating_task->activateAndSchedule();
storage.mutations_updating_task->activateAndSchedule(); storage.mutations_updating_task->activateAndSchedule();
storage.mutations_finalizing_task->activateAndSchedule(); storage.mutations_finalizing_task->activateAndSchedule();
storage.merge_selecting_task->activateAndSchedule(); storage.merge_selecting_task->activateAndSchedule();
storage.cleanup_thread.start(); storage.cleanup_thread.start();
storage.part_check_thread.start();
return true; return true;
} }
@ -356,6 +356,7 @@ void ReplicatedMergeTreeRestartingThread::partialShutdown(bool part_of_full_shut
storage.mutations_finalizing_task->deactivate(); storage.mutations_finalizing_task->deactivate();
storage.cleanup_thread.stop(); storage.cleanup_thread.stop();
storage.part_check_thread.stop();
/// Stop queue processing /// Stop queue processing
{ {
@ -365,9 +366,6 @@ void ReplicatedMergeTreeRestartingThread::partialShutdown(bool part_of_full_shut
storage.background_operations_assignee.finish(); storage.background_operations_assignee.finish();
} }
/// Stop part_check_thread after queue processing, because some queue tasks may restart part_check_thread
storage.part_check_thread.stop();
LOG_TRACE(log, "Threads finished"); LOG_TRACE(log, "Threads finished");
} }