Fix crash

This commit is contained in:
alesapin 2024-11-08 17:26:18 +01:00
parent 3f9183c69f
commit d414dea9b9

View File

@ -1132,6 +1132,8 @@ MergeMutateSelectedEntryPtr StorageMergeTree::selectPartsToMerge(
select_decision = merger_mutator.selectAllPartsToMergeWithinPartition(
future_part, can_merge, partition_id, final, metadata_snapshot, txn, out_disable_reason, optimize_skip_merged_partitions);
future_parts.push_back(future_part);
/// If final - we will wait for currently processing merges to finish and continue.
if (final
&& select_decision != SelectPartsDecision::SELECTED
@ -1148,7 +1150,6 @@ MergeMutateSelectedEntryPtr StorageMergeTree::selectPartsToMerge(
}
else
{
future_parts.push_back(future_part);
break;
}
}