diff options
| author | Dan Engelbrecht <[email protected]> | 2022-03-31 11:18:33 +0200 |
|---|---|---|
| committer | Dan Engelbrecht <[email protected]> | 2022-03-31 11:29:28 +0200 |
| commit | d7331a809702551446496e1a0e86b9fcea42c0e3 (patch) | |
| tree | 485e6bfdf4b76389f15fb7875c424822d5aac9e2 /zenstore/compactcas.cpp | |
| parent | Don hard fail on removing files we no longer care about (diff) | |
| download | zen-d7331a809702551446496e1a0e86b9fcea42c0e3.tar.xz zen-d7331a809702551446496e1a0e86b9fcea42c0e3.zip | |
Improved GC logging
Diffstat (limited to 'zenstore/compactcas.cpp')
| -rw-r--r-- | zenstore/compactcas.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/zenstore/compactcas.cpp b/zenstore/compactcas.cpp index 300420cea..5f335816c 100644 --- a/zenstore/compactcas.cpp +++ b/zenstore/compactcas.cpp @@ -935,18 +935,18 @@ CasContainerStrategy::CollectGarbage(GcContext& GcCtx) // after each new block is written and figuring out the path to the next new block. ZEN_INFO("collecting garbage from '{}'", m_Config.RootDirectory / m_ContainerBaseName); - Stopwatch TotalTimer; - uint64_t WriteBlockTimeUs = 0; - uint64_t WriteBlockLongestTimeUs = 0; - uint64_t ReadBlockTimeUs = 0; - uint64_t ReadBlockLongestTimeUs = 0; - uint64_t TotalChunkCount = 0; - uint64_t DeletedSize = 0; - uint64_t OldTotalSize = m_TotalSize.load(std::memory_order::relaxed); + uint64_t WriteBlockTimeUs = 0; + uint64_t WriteBlockLongestTimeUs = 0; + uint64_t ReadBlockTimeUs = 0; + uint64_t ReadBlockLongestTimeUs = 0; + uint64_t TotalChunkCount = 0; + uint64_t DeletedSize = 0; + uint64_t OldTotalSize = m_TotalSize.load(std::memory_order::relaxed); std::vector<IoHash> DeletedChunks; uint64_t MovedCount = 0; + Stopwatch TotalTimer; const auto _ = MakeGuard([this, &TotalTimer, &WriteBlockTimeUs, @@ -957,9 +957,9 @@ CasContainerStrategy::CollectGarbage(GcContext& GcCtx) &DeletedChunks, &MovedCount, &DeletedSize, - &OldTotalSize] { + OldTotalSize] { ZEN_INFO( - "garbage collect from '{}' DONE after {}, write lock: {} ({}), read lock: {} ({}), collected {} bytes, deleted {} and moved {} " + "garbage collect for '{}' DONE after {}, write lock: {} ({}), read lock: {} ({}), collected {} bytes, deleted {} and moved {} " "of {} " "chunks ({}).", m_Config.RootDirectory / m_ContainerBaseName, @@ -1082,7 +1082,7 @@ CasContainerStrategy::CollectGarbage(GcContext& GcCtx) if (!PerformDelete) { uint64_t TotalSize = m_TotalSize.load(std::memory_order_relaxed); - ZEN_INFO("garbage collect from '{}' DISABLED, found #{} {} chunks of total #{} {}", + ZEN_INFO("garbage collect for '{}' DISABLED, found #{} {} chunks of total #{} {}", m_Config.RootDirectory / m_ContainerBaseName, DeleteCount, NiceBytes(TotalSize - NewTotalSize), @@ -1198,7 +1198,7 @@ CasContainerStrategy::CollectGarbage(GcContext& GcCtx) std::filesystem::path GCReservePath = GetGCReservePath(m_Config.RootDirectory, m_ContainerBaseName); if (!std::filesystem::is_regular_file(GCReservePath)) { - ZEN_INFO("garbage collect from '{}' FAILED, required disk space {}, free {}", + ZEN_INFO("garbage collect for '{}' FAILED, required disk space {}, free {}", m_Config.RootDirectory / m_ContainerBaseName, m_MaxBlockSize, NiceBytes(Space.Free)); @@ -1293,7 +1293,7 @@ CasContainerStrategy::CollectGarbage(GcContext& GcCtx) } if (Space.Free < m_MaxBlockSize) { - ZEN_INFO("not enough space for garbage collect reserve '{}' FAILED, required disk space {}, free {}", + ZEN_INFO("not enough space for garbage collect reserve for '{}' FAILED, required disk space {}, free {}", m_Config.RootDirectory / m_ContainerBaseName, m_MaxBlockSize, NiceBytes(Space.Free)); @@ -1304,17 +1304,17 @@ CasContainerStrategy::CollectGarbage(GcContext& GcCtx) GCReserveFile.Open(GCReservePath, BasicFile::EMode::kTruncate); GCReserveFile.SetFileSize(m_MaxBlockSize); - ZEN_DEBUG("recreated garbage collect reserve '{}', {} bytes", m_Config.RootDirectory / m_ContainerBaseName, NiceBytes(Space.Free)); + ZEN_DEBUG("recreated garbage collect reserve for '{}', {} bytes", m_Config.RootDirectory / m_ContainerBaseName, NiceBytes(Space.Free)); } void CasContainerStrategy::MakeIndexSnapshot() { - ZEN_INFO("write store {} snapshot", m_Config.RootDirectory / m_ContainerBaseName); + ZEN_INFO("write store snapshot for '{}'", m_Config.RootDirectory / m_ContainerBaseName); uint64_t EntryCount = 0; Stopwatch Timer; const auto _ = MakeGuard([this, &EntryCount, &Timer] { - ZEN_INFO("write store {} snapshot containing {} entries in {}", + ZEN_INFO("write store snapshot for '{}' containing {} entries in {}", m_Config.RootDirectory / m_ContainerBaseName, EntryCount, NiceTimeSpanMs(Timer.GetElapsedTimeMs())); @@ -1552,7 +1552,7 @@ CasContainerStrategy::OpenContainer(bool IsNewStore) { // Log removing unreferenced block // Clear out unused blocks - ZEN_INFO("removing unused block in {} at {}", m_Config.RootDirectory / m_ContainerBaseName, Path); + ZEN_INFO("removing unused block for '{}' at '{}'", m_Config.RootDirectory / m_ContainerBaseName, Path); std::error_code Ec; std::filesystem::remove(Path, Ec); if (Ec) @@ -1594,7 +1594,7 @@ CasContainerStrategy::OpenContainer(bool IsNewStore) else { // We need it to be the proper size if we are to use it - ZEN_WARN("removing gc reserve {}, not enough space free on drive, need {}, have {} ", + ZEN_WARN("removing gc reserve for '{}', not enough space free on drive, need {}, have {} ", m_Config.RootDirectory / m_ContainerBaseName, NiceBytes(m_MaxBlockSize), NiceBytes(Space.Free)); @@ -1617,7 +1617,7 @@ CasContainerStrategy::OpenContainer(bool IsNewStore) } else { - ZEN_WARN("can't create gc reserve {}, not enough space free on drive, need {}, have {} ", + ZEN_WARN("can't create gc reserve for '{}', not enough space free on drive, need {}, have {} ", m_Config.RootDirectory / m_ContainerBaseName, NiceBytes(m_MaxBlockSize), NiceBytes(Space.Free)); |