This commit is contained in:
alesapin 2021-06-24 00:09:06 +03:00
parent 24876291d1
commit e6da53dc46

View File

@ -2328,6 +2328,9 @@ MergeTreeData::DataPartsVector MergeTreeData::removePartsInRangeFromWorkingSet(c
for (const DataPartPtr & part : partition_range) for (const DataPartPtr & part : partition_range)
{ {
if (part->info.partition_id != drop_range.partition_id)
throw Exception("Unexpected partition_id of part " + part->name + ". This is a bug.", ErrorCodes::LOGICAL_ERROR);
/// It's a DROP PART and it's already executed by fetching some covering part /// It's a DROP PART and it's already executed by fetching some covering part
if (part->info != drop_range && part->info.contains(drop_range)) if (part->info != drop_range && part->info.contains(drop_range))
{ {
@ -2335,9 +2338,6 @@ MergeTreeData::DataPartsVector MergeTreeData::removePartsInRangeFromWorkingSet(c
return {}; return {};
} }
if (part->info.partition_id != drop_range.partition_id)
throw Exception("Unexpected partition_id of part " + part->name + ". This is a bug.", ErrorCodes::LOGICAL_ERROR);
if (part->info.min_block < drop_range.min_block) if (part->info.min_block < drop_range.min_block)
{ {
if (drop_range.min_block <= part->info.max_block) if (drop_range.min_block <= part->info.max_block)