And waits for them. That's pointless.
bool has_volumes_with_disabled_merges = storage_policy->hasAnyVolumeWithDisabledMerges();
    const String * prev_partition_id = nullptr;
    
    const MergeTreeData::DataPartPtr * prev_part = nullptr;
    size_t parts_selected_precondition = 0;
    for (const MergeTreeData::DataPartPtr & part : data_parts)
    {
        const String & partition_id = part->info.partition_id;
        if (!prev_partition_id || partition_id != *prev_partition_id)
        {
            if (parts_ranges.empty() || !parts_ranges.back().empty())
                parts_ranges.emplace_back();
            
            prev_partition_id = &partition_id;
            prev_part = nullptr;
        }
        
        if (!prev_part)
        {
            /* Parts can be merged with themselves for TTL needs for example.
            * So we have to check if this part is currently being inserted with quorum and so on and so forth.
            * Obviously we have to check it manually only for the first part
            * of each partition because it will be automatically checked for a pair of parts. */
            if (!can_merge_callback(nullptr, part, nullptr))
                continue;
            
            
            if (!parts_ranges.back().empty())
                parts_ranges.emplace_back();