Update MergeTreeData.cpp

This commit is contained in:
tavplubix 2021-04-21 15:34:42 +03:00 committed by GitHub
parent 20a5fed53e
commit 1a776b47a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1391,12 +1391,19 @@ void MergeTreeData::dropIfEmpty()
if (!data_parts_by_info.empty())
return;
for (const auto & [path, disk] : getRelativeDataPathsWithDisks())
try
{
/// Non recursive, exception is thrown if there are more files.
disk->removeFile(path + MergeTreeData::FORMAT_VERSION_FILE_NAME);
disk->removeDirectory(path + MergeTreeData::DETACHED_DIR_NAME);
disk->removeDirectory(path);
for (const auto & [path, disk] : getRelativeDataPathsWithDisks())
{
/// Non recursive, exception is thrown if there are more files.
disk->removeFileIfExists(path + MergeTreeData::FORMAT_VERSION_FILE_NAME);
disk->removeDirectory(path + MergeTreeData::DETACHED_DIR_NAME);
disk->removeDirectory(path);
}
}
catch (...)
{
tryLogCurrentException(__PRETTY_FUNCTION__);
}
}