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.
{
    if (table_shared_id != UUIDHelpers::Nil)
        throw Exception(ErrorCodes::LOGICAL_ERROR, "Table shared id already initialized");
    zkutil::ZooKeeperPtr zookeeper = getZooKeeper();
    String zookeeper_table_id_path = fs::path(zookeeper_path) / "table_shared_id";
    String id;
    if (!zookeeper->tryGet(zookeeper_table_id_path, id))
    {
        UUID table_id_candidate;
        auto local_storage_id = getStorageID();
        if (local_storage_id.uuid != UUIDHelpers::Nil)
            table_id_candidate = local_storage_id.uuid;
        else
            table_id_candidate = UUIDHelpers::generateV4();
        id = toString(table_id_candidate);
        auto code = zookeeper->tryCreate(zookeeper_table_id_path, id, zkutil::CreateMode::Persistent);
        if (code == Coordination::Error::ZNODEEXISTS)
        { 
            id = zookeeper->get(zookeeper_table_id_path);
        }
        else if (code != Coordination::Error::ZOK)
        {
            throw zkutil::KeeperException(code, zookeeper_table_id_path);
        }
    }
    table_shared_id = parseFromString<UUID>(id);
}
void StorageReplicatedMergeTree::lockSharedDataTemporary(const String & part_name, const String & part_id, const DiskPtr & disk) const