aboutsummaryrefslogtreecommitdiff
path: root/zenstore/compactcas.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2022-12-02 16:56:51 +0100
committerGitHub <[email protected]>2022-12-02 07:56:51 -0800
commit921078b38bfa91424c27ff707d950e26c18d3cd3 (patch)
treee71446e3ebc29f7ff8ad47c0c23d8b2e49211dbe /zenstore/compactcas.cpp
parentreduce gc log spam (INFO -> DEBUG) (#199) (diff)
downloadzen-921078b38bfa91424c27ff707d950e26c18d3cd3.tar.xz
zen-921078b38bfa91424c27ff707d950e26c18d3cd3.zip
Size based gc trigger (#197)
- Feature: Disk size triggered GC, a soft disk usage limit for cache data. - Feature: New option `--gc-disk-size-soft-limit` (command line), `gc.cache.disksizesoftlimit` (lua config) controlling limit for soft disk usage limit. Defaults to zero which disables soft disk usage limit. - Improvement: Disk write pressure in GC log and cleaned up clutter in GC logging.
Diffstat (limited to 'zenstore/compactcas.cpp')
-rw-r--r--zenstore/compactcas.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/zenstore/compactcas.cpp b/zenstore/compactcas.cpp
index e52f5b7cb..7507a82f6 100644
--- a/zenstore/compactcas.cpp
+++ b/zenstore/compactcas.cpp
@@ -903,7 +903,7 @@ TEST_CASE("compactcas.gc.basic")
CHECK(InsertResult.New);
Cas.Flush();
- GcContext GcCtx;
+ GcContext GcCtx(GcClock::Now() - std::chrono::hours(24));
GcCtx.CollectSmallObjects(true);
Cas.CollectGarbage(GcCtx);
@@ -933,7 +933,7 @@ TEST_CASE("compactcas.gc.removefile")
CasContainerStrategy Cas(Gc);
Cas.Initialize(TempDir.Path(), "cb", 65536, 1 << 4, false);
- GcContext GcCtx;
+ GcContext GcCtx(GcClock::Now() - std::chrono::hours(24));
GcCtx.CollectSmallObjects(true);
Cas.CollectGarbage(GcCtx);
@@ -988,7 +988,7 @@ TEST_CASE("compactcas.gc.compact")
// Keep first and last
{
- GcContext GcCtx;
+ GcContext GcCtx(GcClock::Now() - std::chrono::hours(24));
GcCtx.CollectSmallObjects(true);
std::vector<IoHash> KeepChunks;
@@ -1023,7 +1023,7 @@ TEST_CASE("compactcas.gc.compact")
// Keep last
{
- GcContext GcCtx;
+ GcContext GcCtx(GcClock::Now() - std::chrono::hours(24));
GcCtx.CollectSmallObjects(true);
std::vector<IoHash> KeepChunks;
KeepChunks.push_back(ChunkHashes[8]);
@@ -1055,7 +1055,7 @@ TEST_CASE("compactcas.gc.compact")
// Keep mixed
{
- GcContext GcCtx;
+ GcContext GcCtx(GcClock::Now() - std::chrono::hours(24));
GcCtx.CollectSmallObjects(true);
std::vector<IoHash> KeepChunks;
KeepChunks.push_back(ChunkHashes[1]);
@@ -1090,7 +1090,7 @@ TEST_CASE("compactcas.gc.compact")
// Keep multiple at end
{
- GcContext GcCtx;
+ GcContext GcCtx(GcClock::Now() - std::chrono::hours(24));
GcCtx.CollectSmallObjects(true);
std::vector<IoHash> KeepChunks;
KeepChunks.push_back(ChunkHashes[6]);
@@ -1125,7 +1125,7 @@ TEST_CASE("compactcas.gc.compact")
// Keep every other
{
- GcContext GcCtx;
+ GcContext GcCtx(GcClock::Now() - std::chrono::hours(24));
GcCtx.CollectSmallObjects(true);
std::vector<IoHash> KeepChunks;
KeepChunks.push_back(ChunkHashes[0]);
@@ -1204,7 +1204,7 @@ TEST_CASE("compactcas.gc.deleteblockonopen")
// GC every other block
{
- GcContext GcCtx;
+ GcContext GcCtx(GcClock::Now() - std::chrono::hours(24));
GcCtx.CollectSmallObjects(true);
std::vector<IoHash> KeepChunks;
for (size_t i = 0; i < 20; i += 2)
@@ -1271,7 +1271,7 @@ TEST_CASE("compactcas.gc.handleopeniobuffer")
Cas.Flush();
// GC everything
- GcContext GcCtx;
+ GcContext GcCtx(GcClock::Now() - std::chrono::hours(24));
GcCtx.CollectSmallObjects(true);
Cas.CollectGarbage(GcCtx);
@@ -1427,7 +1427,7 @@ TEST_CASE("compactcas.threadedinsert")
C++;
}
- GcContext GcCtx;
+ GcContext GcCtx(GcClock::Now() - std::chrono::hours(24));
GcCtx.CollectSmallObjects(true);
GcCtx.AddRetainedCids(KeepHashes);
Cas.CollectGarbage(GcCtx);
@@ -1468,7 +1468,7 @@ TEST_CASE("compactcas.threadedinsert")
C++;
}
- GcContext GcCtx;
+ GcContext GcCtx(GcClock::Now() - std::chrono::hours(24));
GcCtx.CollectSmallObjects(true);
GcCtx.AddRetainedCids(KeepHashes);
Cas.CollectGarbage(GcCtx);