aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2023-10-20 11:02:02 +0200
committerGitHub <[email protected]>2023-10-20 11:02:02 +0200
commit42cf81240256b92ef423a15add32d8b564375c7d (patch)
tree2ec5103d1e1278b3b727955a6f92e99f8451ea1d /src/zenstore
parentChange shared server config to use port 8558 (diff)
downloadzen-42cf81240256b92ef423a15add32d8b564375c7d.tar.xz
zen-42cf81240256b92ef423a15add32d8b564375c7d.zip
Add --skip-delete option to gc command (#484)
- Feature: Add `--skip-delete` option to gc command - Bugfix: Fix implementation when claiming GC reserve during GC
Diffstat (limited to 'src/zenstore')
-rw-r--r--src/zenstore/compactcas.cpp2
-rw-r--r--src/zenstore/gc.cpp4
-rw-r--r--src/zenstore/include/zenstore/gc.h1
3 files changed, 6 insertions, 1 deletions
diff --git a/src/zenstore/compactcas.cpp b/src/zenstore/compactcas.cpp
index 715704c2e..a6bd71bd7 100644
--- a/src/zenstore/compactcas.cpp
+++ b/src/zenstore/compactcas.cpp
@@ -538,7 +538,7 @@ CasContainerStrategy::CollectGarbage(GcContext& GcCtx)
m_CasLog.Append(LogEntries);
m_CasLog.Flush();
},
- [&GcCtx]() { return GcCtx.CollectSmallObjects(); });
+ [&GcCtx]() { return GcCtx.ClaimGCReserve(); });
if (!DeletedChunks.empty())
{
diff --git a/src/zenstore/gc.cpp b/src/zenstore/gc.cpp
index 0e4c49f65..3d8e66a8b 100644
--- a/src/zenstore/gc.cpp
+++ b/src/zenstore/gc.cpp
@@ -880,6 +880,10 @@ GcScheduler::SchedulerThread()
{
SkipCid = true;
}
+ if (TriggerParams.SkipDelete)
+ {
+ DoDelete = false;
+ }
}
if (m_TriggerScrubParams)
diff --git a/src/zenstore/include/zenstore/gc.h b/src/zenstore/include/zenstore/gc.h
index aaa156ebf..1c455abe5 100644
--- a/src/zenstore/include/zenstore/gc.h
+++ b/src/zenstore/include/zenstore/gc.h
@@ -257,6 +257,7 @@ public:
std::chrono::seconds MaxProjectStoreDuration = std::chrono::seconds::max();
uint64_t DiskSizeSoftLimit = 0;
bool SkipCid = false;
+ bool SkipDelete = false;
};
bool TriggerGc(const TriggerGcParams& Params);