aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/include
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2024-09-30 09:59:34 +0200
committerGitHub Enterprise <[email protected]>2024-09-30 09:59:34 +0200
commitebec68d49b2c968ecf684973b33f9f3d1d56b702 (patch)
tree39de29b8d6b24d071d38254e40b5ee850b7c1299 /src/zenstore/include
parentoptimize startup time (#175) (diff)
downloadzen-ebec68d49b2c968ecf684973b33f9f3d1d56b702.tar.xz
zen-ebec68d49b2c968ecf684973b33f9f3d1d56b702.zip
gc command attachment options (#176)
* zen command - add options to control meta data cache when triggering gc
Diffstat (limited to 'src/zenstore/include')
-rw-r--r--src/zenstore/include/zenstore/cache/cachedisklayer.h9
-rw-r--r--src/zenstore/include/zenstore/gc.h12
2 files changed, 14 insertions, 7 deletions
diff --git a/src/zenstore/include/zenstore/cache/cachedisklayer.h b/src/zenstore/include/zenstore/cache/cachedisklayer.h
index 6d85e8039..f38776b6e 100644
--- a/src/zenstore/include/zenstore/cache/cachedisklayer.h
+++ b/src/zenstore/include/zenstore/cache/cachedisklayer.h
@@ -105,11 +105,10 @@ class ZenCacheDiskLayer
public:
struct BucketConfiguration
{
- uint64_t MaxBlockSize = 1ull << 30;
- uint32_t PayloadAlignment = 1u << 4;
- uint64_t MemCacheSizeThreshold = 1 * 1024;
- uint64_t LargeObjectThreshold = 128 * 1024;
- bool StoreAttachmentMetaData = false;
+ uint64_t MaxBlockSize = 1ull << 30;
+ uint32_t PayloadAlignment = 1u << 4;
+ uint64_t MemCacheSizeThreshold = 1 * 1024;
+ uint64_t LargeObjectThreshold = 128 * 1024;
};
struct Configuration
diff --git a/src/zenstore/include/zenstore/gc.h b/src/zenstore/include/zenstore/gc.h
index 56965e3e3..b79f1b9df 100644
--- a/src/zenstore/include/zenstore/gc.h
+++ b/src/zenstore/include/zenstore/gc.h
@@ -64,8 +64,10 @@ struct GcSettings
90; // 0 = compact only empty eligible blocks, 100 = compact all non-full eligible blocks, 1-99 = compact eligible blocks with less
// usage than CompactBlockUsageThresholdPercent
std::filesystem::path DiskReservePath;
- IoHash AttachmentRangeMin = IoHash::Zero;
- IoHash AttachmentRangeMax = IoHash::Max;
+ IoHash AttachmentRangeMin = IoHash::Zero;
+ IoHash AttachmentRangeMax = IoHash::Max;
+ bool StoreCacheAttachmentMetaData = false;
+ bool StoreProjectAttachmentMetaData = false;
};
struct GcCompactStoreStats
@@ -452,6 +454,8 @@ struct GcSchedulerConfig
bool Verbose = false;
bool SingleThreaded = false;
uint16_t AttachmentPassCount = 1;
+ bool StoreCacheAttachmentMetaData = false;
+ bool StoreProjectAttachmentMetaData = false;
};
struct GcSchedulerState
@@ -531,6 +535,8 @@ public:
std::optional<bool> SingleThreaded;
std::optional<IoHash> AttachmentRangeMin;
std::optional<IoHash> AttachmentRangeMax;
+ std::optional<bool> StoreCacheAttachmentMetaData = false;
+ std::optional<bool> StoreProjectAttachmentMetaData = false;
};
bool TriggerGc(const TriggerGcParams& Params);
@@ -560,6 +566,8 @@ private:
bool SingleThreaded,
const IoHash& AttachmentRangeMin,
const IoHash& AttachmentRangeMax,
+ bool StoreCacheAttachmentMetaData,
+ bool StoreProjectAttachmentMetaData,
bool SilenceErrors);
void ScrubStorage(bool DoDelete, bool SkipCid, std::chrono::seconds TimeSlice);
LoggerRef Log() { return m_Log; }