mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-10-06 00:20:51 +00:00
Fix bug in initialization
This commit is contained in:
parent
d6f33cf161
commit
1f4b42a99f
@ -75,8 +75,7 @@ bool ReplicatedMergeTreeAltersSequence::canExecuteDataAlter(int alter_version, s
|
||||
|
||||
bool ReplicatedMergeTreeAltersSequence::canExecuteMetaAlter(int alter_version, std::lock_guard<std::mutex> & /*state_lock*/) const
|
||||
{
|
||||
if (queue_state.empty())
|
||||
return true;
|
||||
assert(!queue_state.empty());
|
||||
|
||||
/// We can execute only alters of metadata which are in head.
|
||||
return queue_state.begin()->first == alter_version;
|
||||
|
@ -2933,15 +2933,15 @@ void StorageReplicatedMergeTree::startup()
|
||||
data_parts_exchange_endpoint = std::make_shared<DataPartsExchange::Service>(*this);
|
||||
global_context.getInterserverIOHandler().addEndpoint(data_parts_exchange_endpoint->getId(replica_path), data_parts_exchange_endpoint);
|
||||
|
||||
queue_task_handle = global_context.getBackgroundPool().addTask([this] { return queueTask(); });
|
||||
if (areBackgroundMovesNeeded())
|
||||
move_parts_task_handle = global_context.getBackgroundMovePool().addTask([this] { return movePartsTask(); });
|
||||
|
||||
/// In this thread replica will be activated.
|
||||
restarting_thread.start();
|
||||
|
||||
/// Wait while restarting_thread initializes LeaderElection (and so on) or makes first attmept to do it
|
||||
startup_event.wait();
|
||||
|
||||
queue_task_handle = global_context.getBackgroundPool().addTask([this] { return queueTask(); });
|
||||
if (areBackgroundMovesNeeded())
|
||||
move_parts_task_handle = global_context.getBackgroundMovePool().addTask([this] { return movePartsTask(); });
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user