For some reasons when we delete a MergeTree Part in atomic way something may go wrong - and leave the `delete_tmp_*` folder or it's part on disk. This may lead to a disk space consumption over time.

It's suggested to delete this folders at least at server start-up. Current solution with `clearOldTemporaryDirectories()` doesn't work because this method is called periodically from a thread without any locks or advisory on folders - it may cause the race conditions.
{
    auto zookeeper = getZooKeeper();
    
    
    
    auto broken_part_info = MergeTreePartInfo::fromPartName(part_name, format_version);
    auto partition_range = getVisibleDataPartsVectorInPartition(getContext(), broken_part_info.partition_id);
    for (const auto & part : partition_range)
    {
        if (!broken_part_info.contains(part->info))
            continue;
        
        assert(broken_part_info != part->info);
        part->makeCloneInDetached("covered-by-broken", getInMemoryMetadataPtr());
    }
    
    
    
    
    
    
    
    
    
    
    queue.removePartProducingOpsInRange(zookeeper, broken_part_info, {});