mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-18 13:42:02 +00:00
Fix locking
This commit is contained in:
parent
45edc8c861
commit
0193a9d087
@ -7428,14 +7428,18 @@ bool StorageReplicatedMergeTree::createEmptyPartInsteadOfLost(zkutil::ZooKeeperP
|
||||
new_data_part->setColumns(columns);
|
||||
new_data_part->rows_count = block.rows();
|
||||
|
||||
auto parts_in_partition = getDataPartsPartitionRange(new_part_info.partition_id);
|
||||
if (parts_in_partition.empty())
|
||||
{
|
||||
LOG_WARNING(log, "Empty part {} is not created instead of lost part because there are no parts in partition {} (it's empty), resolve this manually using DROP PARTITION.", lost_part_name, new_part_info.partition_id);
|
||||
return false;
|
||||
auto lock = lockParts();
|
||||
auto parts_in_partition = getDataPartsPartitionRange(new_part_info.partition_id);
|
||||
if (parts_in_partition.empty())
|
||||
{
|
||||
LOG_WARNING(log, "Empty part {} is not created instead of lost part because there are no parts in partition {} (it's empty), resolve this manually using DROP PARTITION.", lost_part_name, new_part_info.partition_id);
|
||||
return false;
|
||||
}
|
||||
|
||||
new_data_part->partition = (*parts_in_partition.begin())->partition;
|
||||
}
|
||||
|
||||
new_data_part->partition = (*parts_in_partition.begin())->partition;
|
||||
new_data_part->minmax_idx = std::move(minmax_idx);
|
||||
new_data_part->is_temp = true;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user