fix intersecting part if session expired during queue initialization

This commit is contained in:
Alexander Tokmakov 2022-09-30 19:11:05 +02:00
parent 7b5b7e4963
commit 3f9c9c9a77

View File

@ -41,7 +41,7 @@ ReplicatedMergeTreeQueue::ReplicatedMergeTreeQueue(StorageReplicatedMergeTree &
void ReplicatedMergeTreeQueue::clear() void ReplicatedMergeTreeQueue::clear()
{ {
auto locks = lockQueue(); auto locks = lockQueue();
assert(future_parts.empty()); chassert(future_parts.empty());
current_parts.clear(); current_parts.clear();
virtual_parts.clear(); virtual_parts.clear();
queue.clear(); queue.clear();
@ -62,6 +62,7 @@ void ReplicatedMergeTreeQueue::setBrokenPartsToEnqueueFetchesOnLoading(Strings &
void ReplicatedMergeTreeQueue::initialize(zkutil::ZooKeeperPtr zookeeper) void ReplicatedMergeTreeQueue::initialize(zkutil::ZooKeeperPtr zookeeper)
{ {
clear();
std::lock_guard lock(state_mutex); std::lock_guard lock(state_mutex);
LOG_TRACE(log, "Initializing parts in queue"); LOG_TRACE(log, "Initializing parts in queue");