Skip to content

Commit

Permalink
Merge pull request #58582 from ClickHouse/backport/23.12/58574
Browse files Browse the repository at this point in the history
Backport #58574 to 23.12: Follow-up to #58482
  • Loading branch information
robot-ch-test-poll4 committed Jan 8, 2024
2 parents 4175730 + c59558a commit c493ad2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Storages/MergeTree/MergeTreeData.cpp
Expand Up @@ -4002,9 +4002,13 @@ MergeTreeData::PartsToRemoveFromZooKeeper MergeTreeData::removePartsInRangeFromW
/// We don't need to commit it to zk, and don't even need to activate it.

MergeTreePartInfo empty_info = drop_range;
empty_info.min_block = empty_info.level = empty_info.mutation = 0;
empty_info.level = empty_info.mutation = 0;
empty_info.min_block = MergeTreePartInfo::MAX_BLOCK_NUMBER;
for (const auto & part : parts_to_remove)
{
/// We still have to take min_block into account to avoid creating multiple covering ranges
/// that intersect each other
empty_info.min_block = std::min(empty_info.min_block, part->info.min_block);
empty_info.level = std::max(empty_info.level, part->info.level);
empty_info.mutation = std::max(empty_info.mutation, part->info.mutation);
}
Expand Down

0 comments on commit c493ad2

Please sign in to comment.