mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 00:52:02 +00:00
Move queue initialization to restarting thread
This commit is contained in:
parent
91e10adca5
commit
ab41384f63
@ -59,6 +59,11 @@ void ReplicatedMergeTreeQueue::initialize(zkutil::ZooKeeperPtr zookeeper)
|
||||
{
|
||||
std::lock_guard lock(state_mutex);
|
||||
|
||||
/// Clear parts before setting new one
|
||||
current_parts.clear();
|
||||
virtual_parts.clear();
|
||||
|
||||
/// Get current parts state from zookeeper
|
||||
Strings parts = zookeeper->getChildren(replica_path + "/parts");
|
||||
for (const auto & part_name : parts)
|
||||
{
|
||||
|
@ -174,6 +174,8 @@ bool ReplicatedMergeTreeRestartingThread::tryStartup()
|
||||
|
||||
try
|
||||
{
|
||||
storage.queue.initialize(zookeeper);
|
||||
|
||||
storage.queue.load(zookeeper);
|
||||
|
||||
/// pullLogsToQueue() after we mark replica 'is_active' (and after we repair if it was lost);
|
||||
|
@ -4285,8 +4285,6 @@ void StorageReplicatedMergeTree::startup()
|
||||
|
||||
try
|
||||
{
|
||||
queue.initialize(getZooKeeper());
|
||||
|
||||
InterserverIOEndpointPtr data_parts_exchange_ptr = std::make_shared<DataPartsExchange::Service>(*this);
|
||||
[[maybe_unused]] auto prev_ptr = std::atomic_exchange(&data_parts_exchange_endpoint, data_parts_exchange_ptr);
|
||||
assert(prev_ptr == nullptr);
|
||||
|
Loading…
Reference in New Issue
Block a user