And waits for them. That's pointless.
auto data_parts_lock = lockParts();
            transaction.commit(&data_parts_lock);
            if (replace)
                parts_to_remove = removePartsInRangeFromWorkingSet(drop_range, true, data_parts_lock);
        }
        PartLog::addNewParts(getContext(), dst_parts, watch.elapsed());
    }
    catch (...)
    {
        PartLog::addNewParts(getContext(), dst_parts, watch.elapsed(), ExecutionStatus::fromCurrentException());
        throw;
    }
    String log_znode_path = dynamic_cast<const Coordination::CreateResponse &>(*op_results.back()).path_created;
    entry.znode_name = log_znode_path.substr(log_znode_path.find_last_of('/') + 1);
    for (auto & lock : ephemeral_locks)
        lock.assumeUnlocked();
    
    tryRemovePartsFromZooKeeperWithRetries(parts_to_remove);
    
    parts_to_remove.clear();
    cleanup_thread.wakeup();
    
    if (query_context->getSettingsRef().replication_alter_partitions_sync > 1)
    {
        lock2.reset();
        lock1.reset();
        waitForAllReplicasToProcessLogEntry(entry);
    }
}
void StorageReplicatedMergeTree::movePartitionToTable(const StoragePtr & dest_table, const ASTPtr & partition, ContextPtr query_context)