aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/cache/cachedisklayer.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2023-11-21 16:58:43 +0100
committerGitHub <[email protected]>2023-11-21 16:58:43 +0100
commit669a8869b5414c0e8708dd90b1f4aa297d091887 (patch)
treec81c309cf3013e3129caeefb5c3eaba2aaed6967 /src/zenserver/cache/cachedisklayer.cpp
parentfixed paths in ue_build_linux/README.md (diff)
downloadzen-669a8869b5414c0e8708dd90b1f4aa297d091887.tar.xz
zen-669a8869b5414c0e8708dd90b1f4aa297d091887.zip
add command line options for compact block threshold and gc verbose (#557)
- Feature: Added new options to zenserver for GC V2 - `--gc-compactblock-threshold` GCV2 - how much of a compact block should be used to skip compacting the block, default is 90% - `--gc-verbose` GCV2 - enable more verbose output when running a GC pass - Feature: Added new options to `zen gc` command for GC V2 - `--compactblockthreshold` GCV2 - how much of a compact block should be used to skip compacting the block, default is 90% - `--verbose` GCV2 - enable more verbose output when running a GC pass - Feature: Added new parameters for endpoint `admin/gc` (PUT) - `compactblockthreshold` GCV2 - how much of a compact block should be used to skip compacting the block, default is 90% - `verbose` GCV2 - enable more verbose output when running a GC pass
Diffstat (limited to 'src/zenserver/cache/cachedisklayer.cpp')
-rw-r--r--src/zenserver/cache/cachedisklayer.cpp29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/zenserver/cache/cachedisklayer.cpp b/src/zenserver/cache/cachedisklayer.cpp
index 32ef420d1..2be32e372 100644
--- a/src/zenserver/cache/cachedisklayer.cpp
+++ b/src/zenserver/cache/cachedisklayer.cpp
@@ -2502,7 +2502,10 @@ public:
if (Ctx.Settings.IsDeleteMode)
{
- ZEN_DEBUG("GCV2: cachebucket [COMPACT] '{}': compacting {} blocks", m_Bucket.m_BucketDir, BlocksToCompact.size());
+ if (Ctx.Settings.Verbose)
+ {
+ ZEN_INFO("GCV2: cachebucket [COMPACT] '{}': compacting {} blocks", m_Bucket.m_BucketDir, BlocksToCompact.size());
+ }
m_Bucket.m_BlockStore.CompactBlocks(
BlockCompactState,
@@ -2539,9 +2542,12 @@ public:
}
else
{
- ZEN_DEBUG("GCV2: cachebucket [COMPACT] '{}': skipped compacting of {} eligible blocks",
- m_Bucket.m_BucketDir,
- BlocksToCompact.size());
+ if (Ctx.Settings.Verbose)
+ {
+ ZEN_INFO("GCV2: cachebucket [COMPACT] '{}': skipped compacting of {} eligible blocks",
+ m_Bucket.m_BucketDir,
+ BlocksToCompact.size());
+ }
}
}
}
@@ -2712,9 +2718,22 @@ public:
}
}
- virtual void RemoveUsedReferencesFromSet(GcCtx&, HashSet& IoCids) override
+ virtual void RemoveUsedReferencesFromSet(GcCtx& Ctx, HashSet& IoCids) override
{
ZEN_ASSERT(m_IndexLock);
+ size_t InitialCount = IoCids.size();
+ Stopwatch Timer;
+ const auto _ = MakeGuard([&] {
+ if (!Ctx.Settings.Verbose)
+ {
+ return;
+ }
+ ZEN_INFO("GCV2: cachebucket [FILTER REFERENCES] '{}': filtered out {} used references out of {} in {}",
+ m_CacheBucket.m_BucketDir,
+ InitialCount - IoCids.size(),
+ InitialCount,
+ NiceTimeSpanMs(Timer.GetElapsedTimeMs()));
+ });
for (const IoHash& ReferenceHash : m_CacheBucket.m_ReferenceHashes)
{