Try fix strange terminate (#1329)

* Tests: External: rename --use_http  => --no_http and fix

* Try fix strange terminate
This commit is contained in:
proller 2017-10-12 23:42:58 +03:00 committed by alexey-milovidov
parent 3a6705af0f
commit b993667156

View File

@ -1975,6 +1975,13 @@ void StorageReplicatedMergeTree::becomeLeader()
if (shutdown_called)
return;
if (merge_selecting_thread.joinable())
{
LOG_INFO(log, "Deleting old leader");
is_leader_node = false; // exit trigger inside thread
merge_selecting_thread.join();
}
LOG_INFO(log, "Became leader");
is_leader_node = true;
merge_selecting_thread = std::thread(&StorageReplicatedMergeTree::mergeSelectingThread, this);