Revert "Try to fix use-after-free error in MergeTree"

This commit is contained in:
alexey-milovidov 2020-05-17 22:36:27 +03:00 committed by GitHub
parent f7b1263d41
commit ca1a9b890d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,18 +93,9 @@ void StorageMergeTree::startup()
/// NOTE background task will also do the above cleanups periodically.
time_after_previous_cleanup.restart();
auto & pool = global_context.getBackgroundPool();
merging_mutating_task_handle = pool.createTask([this] { return mergeMutateTask(); });
/// Ensure that thread started only after assignment to 'merging_mutating_task_handle' is done.
pool.startTask(merging_mutating_task_handle);
merging_mutating_task_handle = global_context.getBackgroundPool().addTask([this] { return mergeMutateTask(); });
if (areBackgroundMovesNeeded())
{
moving_task_handle = pool.createTask([this] { return movePartsTask(); });
pool.startTask(moving_task_handle);
}
moving_task_handle = global_context.getBackgroundMovePool().addTask([this] { return movePartsTask(); });
}