Minor change

This commit is contained in:
Pavel Kruglov 2020-11-20 01:22:40 +03:00
parent 148dc71d0e
commit 4c30857759
3 changed files with 6 additions and 5 deletions

View File

@ -370,7 +370,7 @@ SelectPartsDecision MergeTreeDataMergerMutator::selectAllPartsToMergeWithinParti
MergeTreeData::DataPartsVector parts = selectAllPartsFromPartition(partition_id);
if (parts.empty())
return SelectPartsDecision::NOTHING_TO_MERGE;
return SelectPartsDecision::CANNOT_SELECT;
if (!final && parts.size() == 1)
{
@ -396,7 +396,7 @@ SelectPartsDecision MergeTreeDataMergerMutator::selectAllPartsToMergeWithinParti
/// For the case of one part, we check that it can be merged "with itself".
if ((it != parts.begin() || parts.size() == 1) && !can_merge(*prev_it, *it, out_disable_reason))
{
return SelectPartsDecision::NOTHING_TO_MERGE;
return SelectPartsDecision::CANNOT_SELECT;
}
sum_bytes += (*it)->getBytesOnDisk();

View File

@ -747,8 +747,8 @@ bool StorageMergeTree::merge(
auto merge_mutate_entry = selectPartsToMerge(metadata_snapshot, aggressive, partition_id, final, out_disable_reason, table_lock_holder, &select_decision);
/// If final and there is nothing to merge then we treat this merge as successful
if (final && select_decision == SelectPartsDecision::NOTHING_TO_MERGE)
/// If there is nothing to merge then we treat this merge as successful (needed for optimize final optimization)
if (select_decision == SelectPartsDecision::NOTHING_TO_MERGE)
return true;
if (!merge_mutate_entry)

View File

@ -3859,7 +3859,8 @@ bool StorageReplicatedMergeTree::optimize(
future_merged_part, disk_space, can_merge, partition_id, final, metadata_snapshot, &disable_reason);
}
if (final && select_decision == SelectPartsDecision::NOTHING_TO_MERGE)
/// If there is nothing to merge then we treat this merge as successful (needed for optimize final optimization)
if (select_decision == SelectPartsDecision::NOTHING_TO_MERGE)
break;
if (select_decision != SelectPartsDecision::SELECTED)