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 table_lock = lockForShare(
            RWLockImpl::NO_QUERY, getSettings()->lock_acquire_timeout_for_background_operations);
    auto zookeeper = getZooKeeper();
    
    
    DataPartsVector parts = grabOldParts();
    if (parts.empty())
        return;
    DataPartsVector parts_to_delete_only_from_filesystem;    
    DataPartsVector parts_to_delete_completely;              
    DataPartsVector parts_to_retry_deletion;                 
    DataPartsVector parts_to_remove_from_filesystem;         
    for (const auto & part : parts)
    {
        if (!part->is_duplicate)
            parts_to_delete_completely.emplace_back(part);
        else
            parts_to_delete_only_from_filesystem.emplace_back(part);