diff options
Diffstat (limited to 'zenstore/compactcas.cpp')
| -rw-r--r-- | zenstore/compactcas.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/zenstore/compactcas.cpp b/zenstore/compactcas.cpp index dfaf72727..300420cea 100644 --- a/zenstore/compactcas.cpp +++ b/zenstore/compactcas.cpp @@ -1552,7 +1552,13 @@ CasContainerStrategy::OpenContainer(bool IsNewStore) { // Log removing unreferenced block // Clear out unused blocks - std::filesystem::remove(Path); + ZEN_INFO("removing unused block in {} at {}", m_Config.RootDirectory / m_ContainerBaseName, Path); + std::error_code Ec; + std::filesystem::remove(Path, Ec); + if (Ec) + { + ZEN_WARN("Failed to delete file '{}' reason: '{}'", Path, Ec.message()); + } continue; } std::filesystem::path BlockPath = GetBlockPath(m_BlocksBasePath, BlockIndex); @@ -1593,7 +1599,12 @@ CasContainerStrategy::OpenContainer(bool IsNewStore) NiceBytes(m_MaxBlockSize), NiceBytes(Space.Free)); - std::filesystem::remove(GCReservePath); + std::error_code Ec; + std::filesystem::remove(GCReservePath, Ec); + if (Ec) + { + ZEN_WARN("Failed to delete gc reserve file '{}' reason: '{}'", GCReservePath, Ec.message()); + } } } else |