Fix obvious bug

This commit is contained in:
alesapin 2022-06-06 12:09:29 +02:00
parent 5d186a438c
commit 71a7ae1274

View File

@ -386,11 +386,10 @@ void DiskObjectStorage::removeMetadata(const String & path, std::vector<String>
if (!metadata_storage->isFile(path))
throw Exception(ErrorCodes::BAD_FILE_TYPE, "Path '{}' is not a regular file", path);
auto remote_objects = metadata_storage->getRemotePaths(path);
try
{
auto remote_objects = metadata_storage->getRemotePaths(path);
auto tx = metadata_storage->createTransaction();
uint32_t hardlink_count = metadata_storage->unlinkAndGetHardlinkCount(path, tx);
tx->commit();
@ -499,7 +498,7 @@ void DiskObjectStorage::removeSharedRecursive(const String & path, bool keep_all
}
}
std::optional<UInt64> DiskObjectStorage::tryReserve(UInt64 bytes)
std::optional<UInt64> DiskObjectStorage::tryReserve(UInt64 bytes)
{
std::lock_guard lock(reservation_mutex);