aboutsummaryrefslogtreecommitdiff
path: root/src
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
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')
-rw-r--r--src/zen/cmds/admin_cmd.cpp23
-rw-r--r--src/zen/cmds/admin_cmd.h2
-rw-r--r--src/zenserver/admin/admin.cpp10
-rw-r--r--src/zenserver/config.cpp10
-rw-r--r--src/zenserver/config.h6
-rw-r--r--src/zenserver/projectstore/projectstore.cpp16
-rw-r--r--src/zenserver/projectstore/projectstore.h1
-rw-r--r--src/zenserver/zenserver.cpp9
-rw-r--r--src/zenstore/cache/cachedisklayer.cpp7
-rw-r--r--src/zenstore/gc.cpp37
-rw-r--r--src/zenstore/include/zenstore/cache/cachedisklayer.h9
-rw-r--r--src/zenstore/include/zenstore/gc.h12
12 files changed, 100 insertions, 42 deletions
diff --git a/src/zen/cmds/admin_cmd.cpp b/src/zen/cmds/admin_cmd.cpp
index fbac0bbf3..d7fc1710d 100644
--- a/src/zen/cmds/admin_cmd.cpp
+++ b/src/zen/cmds/admin_cmd.cpp
@@ -131,6 +131,20 @@ GcCommand::GcCommand()
"Reference filter higher limit - defaults to no limit",
cxxopts::value(m_ReferenceHashHigh),
"<refhighlimit>");
+
+ m_Options.add_option("",
+ "",
+ "cache-attachment-store",
+ "Enable storing attachments referenced by a cache record in block store meta data",
+ cxxopts::value(m_StoreCacheAttachmentMetaData)->default_value("false"),
+ "<cache-attachments-store>");
+
+ m_Options.add_option("",
+ "",
+ "projectstore-attachment-store",
+ "Enable storing attachments referenced by project oplogs in meta data",
+ cxxopts::value(m_StoreProjectAttachmentMetaData)->default_value("false"),
+ "<project-attachments-store>");
}
GcCommand::~GcCommand()
@@ -215,6 +229,15 @@ GcCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv)
Params.Add({"verbose", m_Verbose ? "true" : "false"});
Params.Add({"singlethreaded", m_SingleThreaded ? "true" : "false"});
+ if (m_StoreCacheAttachmentMetaData)
+ {
+ Params.Add({"storecacheattachmentmetadata", m_StoreCacheAttachmentMetaData ? "true" : "false"});
+ }
+ if (m_StoreProjectAttachmentMetaData)
+ {
+ Params.Add({"storeprojectattachmentmetadata", m_StoreProjectAttachmentMetaData ? "true" : "false"});
+ }
+
cpr::Session Session;
Session.SetHeader(cpr::Header{{"Accept", "application/json"}});
Session.SetUrl({fmt::format("{}/admin/gc", m_HostName)});
diff --git a/src/zen/cmds/admin_cmd.h b/src/zen/cmds/admin_cmd.h
index f5dd33d32..a8c38d31e 100644
--- a/src/zen/cmds/admin_cmd.h
+++ b/src/zen/cmds/admin_cmd.h
@@ -53,6 +53,8 @@ private:
bool m_SingleThreaded{false};
std::string m_ReferenceHashLow;
std::string m_ReferenceHashHigh;
+ bool m_StoreCacheAttachmentMetaData;
+ bool m_StoreProjectAttachmentMetaData;
};
class GcStatusCommand : public StorageCommand
diff --git a/src/zenserver/admin/admin.cpp b/src/zenserver/admin/admin.cpp
index 88290171d..eb49bac51 100644
--- a/src/zenserver/admin/admin.cpp
+++ b/src/zenserver/admin/admin.cpp
@@ -432,6 +432,16 @@ HttpAdminService::HttpAdminService(GcScheduler& Scheduler,
GcParams.AttachmentRangeMax = IoHash::FromHexString(Param);
}
+ if (auto Param = Params.GetValue("storecacheattachmentmetadata"); Param.empty() == false)
+ {
+ GcParams.StoreCacheAttachmentMetaData = Param == "true"sv;
+ }
+
+ if (auto Param = Params.GetValue("storeprojectattachmentmetadata"); Param.empty() == false)
+ {
+ GcParams.StoreProjectAttachmentMetaData = Param == "true"sv;
+ }
+
const bool Started = m_GcScheduler.TriggerGc(GcParams);
CbObjectWriter Response;
diff --git a/src/zenserver/config.cpp b/src/zenserver/config.cpp
index 530f12ed8..7466255a9 100644
--- a/src/zenserver/config.cpp
+++ b/src/zenserver/config.cpp
@@ -524,11 +524,9 @@ ParseConfigFile(const std::filesystem::path& Path,
"gc-compactblock-threshold"sv);
LuaOptions.AddOption("gc.verbose"sv, ServerOptions.GcConfig.Verbose, "gc-verbose"sv);
LuaOptions.AddOption("gc.single-threaded"sv, ServerOptions.GcConfig.SingleThreaded, "gc-single-threaded"sv);
- LuaOptions.AddOption("gc.cache.attachment.store"sv,
- ServerOptions.StructuredCacheConfig.StoreAttachmentMetaData,
- "gc-cache-attachment-store");
+ LuaOptions.AddOption("gc.cache.attachment.store"sv, ServerOptions.GcConfig.StoreCacheAttachmentMetaData, "gc-cache-attachment-store");
LuaOptions.AddOption("gc.projectstore.attachment.store"sv,
- ServerOptions.ProjectStoreConfig.StoreAttachmentMetaData,
+ ServerOptions.GcConfig.StoreProjectAttachmentMetaData,
"gc-projectstore-attachment-store");
LuaOptions.AddOption("gc.attachment.passes"sv, ServerOptions.GcConfig.AttachmentPassCount, "gc-attachment-passes"sv);
@@ -921,14 +919,14 @@ ParseCliOptions(int argc, char* argv[], ZenServerOptions& ServerOptions)
"",
"gc-cache-attachment-store",
"Enable storing attachments referenced by a cache record in block store meta data.",
- cxxopts::value<bool>(ServerOptions.StructuredCacheConfig.StoreAttachmentMetaData)->default_value("false"),
+ cxxopts::value<bool>(ServerOptions.GcConfig.StoreCacheAttachmentMetaData)->default_value("false"),
"");
options.add_option("gc",
"",
"gc-projectstore-attachment-store",
"Enable storing attachments referenced by project oplogs in meta data.",
- cxxopts::value<bool>(ServerOptions.ProjectStoreConfig.StoreAttachmentMetaData)->default_value("false"),
+ cxxopts::value<bool>(ServerOptions.GcConfig.StoreProjectAttachmentMetaData)->default_value("false"),
"");
options.add_option("gc",
diff --git a/src/zenserver/config.h b/src/zenserver/config.h
index e7b734001..58a31bbb0 100644
--- a/src/zenserver/config.h
+++ b/src/zenserver/config.h
@@ -78,6 +78,8 @@ struct ZenGcConfig
bool SingleThreaded = false;
static constexpr uint16_t GcMaxAttachmentPassCount = 256;
uint16_t AttachmentPassCount = 1;
+ bool StoreCacheAttachmentMetaData = false;
+ bool StoreProjectAttachmentMetaData = false;
};
struct ZenOpenIdProviderConfig
@@ -119,12 +121,12 @@ struct ZenStructuredCacheConfig
uint64_t MemTargetFootprintBytes = 512 * 1024 * 1024;
uint64_t MemTrimIntervalSeconds = 60;
uint64_t MemMaxAgeSeconds = gsl::narrow<uint64_t>(std::chrono::seconds(std::chrono::days(1)).count());
- bool StoreAttachmentMetaData = false;
};
struct ZenProjectStoreConfig
{
- bool StoreAttachmentMetaData = false;
+ bool StoreCacheAttachmentMetaData = false;
+ bool StoreProjectAttachmentMetaData = false;
};
struct ZenWorkspacesConfig
diff --git a/src/zenserver/projectstore/projectstore.cpp b/src/zenserver/projectstore/projectstore.cpp
index 903c31ecd..4a943a565 100644
--- a/src/zenserver/projectstore/projectstore.cpp
+++ b/src/zenserver/projectstore/projectstore.cpp
@@ -5408,7 +5408,7 @@ public:
Oplog->OplogId());
});
- Oplog->GetAttachmentsLocked(m_References, m_ProjectStore.m_Config.StoreAttachmentMetaData);
+ Oplog->GetAttachmentsLocked(m_References, Ctx.Settings.StoreProjectAttachmentMetaData);
}
FilterReferences(Ctx, fmt::format("projectstore [LOCKSTATE] '{}'", "projectstore"), m_References);
}
@@ -5542,7 +5542,7 @@ public:
}
}
- Oplog->GetAttachmentsLocked(m_References, m_ProjectStore.m_Config.StoreAttachmentMetaData);
+ Oplog->GetAttachmentsLocked(m_References, Ctx.Settings.StoreProjectAttachmentMetaData);
m_OplogAccessTime = m_Project->LastOplogAccessTime(m_OplogId);
FilterReferences(Ctx, fmt::format("projectstore [PRECACHE] '{}'", m_OplogBasePath), m_References);
}
@@ -5588,7 +5588,7 @@ public:
}
});
Oplog->Read();
- Oplog->GetAttachmentsLocked(m_AddedReferences, m_ProjectStore.m_Config.StoreAttachmentMetaData);
+ Oplog->GetAttachmentsLocked(m_AddedReferences, Ctx.Settings.StoreProjectAttachmentMetaData);
}
FilterReferences(Ctx, fmt::format("projectstore [LOCKSTATE] '{}'", m_OplogBasePath), m_AddedReferences);
}
@@ -5804,7 +5804,7 @@ TEST_CASE("project.store.create")
std::string_view ProjectName("proj1"sv);
std::filesystem::path BasePath = TempDir.Path() / "projectstore";
- ProjectStore ProjectStore(CidStore, BasePath, Gc, *JobQueue, ProjectStore::Configuration{.StoreAttachmentMetaData = true});
+ ProjectStore ProjectStore(CidStore, BasePath, Gc, *JobQueue, ProjectStore::Configuration{});
std::filesystem::path RootDir = TempDir.Path() / "root";
std::filesystem::path EngineRootDir = TempDir.Path() / "engine";
std::filesystem::path ProjectRootDir = TempDir.Path() / "game";
@@ -5833,7 +5833,7 @@ TEST_CASE("project.store.lifetimes")
CidStore.Initialize(CidConfig);
std::filesystem::path BasePath = TempDir.Path() / "projectstore";
- ProjectStore ProjectStore(CidStore, BasePath, Gc, *JobQueue, ProjectStore::Configuration{.StoreAttachmentMetaData = true});
+ ProjectStore ProjectStore(CidStore, BasePath, Gc, *JobQueue, ProjectStore::Configuration{});
std::filesystem::path RootDir = TempDir.Path() / "root";
std::filesystem::path EngineRootDir = TempDir.Path() / "engine";
std::filesystem::path ProjectRootDir = TempDir.Path() / "game";
@@ -5895,7 +5895,7 @@ TEST_CASE_TEMPLATE("project.store.export",
CidStore.Initialize(CidConfig);
std::filesystem::path BasePath = TempDir.Path() / "projectstore";
- ProjectStore ProjectStore(CidStore, BasePath, Gc, *JobQueue, ProjectStore::Configuration{.StoreAttachmentMetaData = true});
+ ProjectStore ProjectStore(CidStore, BasePath, Gc, *JobQueue, ProjectStore::Configuration{});
std::filesystem::path RootDir = TempDir.Path() / "root";
std::filesystem::path EngineRootDir = TempDir.Path() / "engine";
std::filesystem::path ProjectRootDir = TempDir.Path() / "game";
@@ -5996,7 +5996,7 @@ TEST_CASE("project.store.gc")
CidStore.Initialize(CidConfig);
std::filesystem::path BasePath = TempDir.Path() / "projectstore";
- ProjectStore ProjectStore(CidStore, BasePath, Gc, *JobQueue, ProjectStore::Configuration{.StoreAttachmentMetaData = true});
+ ProjectStore ProjectStore(CidStore, BasePath, Gc, *JobQueue, ProjectStore::Configuration{});
std::filesystem::path RootDir = TempDir.Path() / "root";
std::filesystem::path EngineRootDir = TempDir.Path() / "engine";
@@ -6280,7 +6280,7 @@ TEST_CASE("project.store.partial.read")
CidStore.Initialize(CidConfig);
std::filesystem::path BasePath = TempDir.Path() / "projectstore"sv;
- ProjectStore ProjectStore(CidStore, BasePath, Gc, *JobQueue, ProjectStore::Configuration{.StoreAttachmentMetaData = true});
+ ProjectStore ProjectStore(CidStore, BasePath, Gc, *JobQueue, ProjectStore::Configuration{});
std::filesystem::path RootDir = TempDir.Path() / "root"sv;
std::filesystem::path EngineRootDir = TempDir.Path() / "engine"sv;
diff --git a/src/zenserver/projectstore/projectstore.h b/src/zenserver/projectstore/projectstore.h
index 273a6d5c4..2552f657f 100644
--- a/src/zenserver/projectstore/projectstore.h
+++ b/src/zenserver/projectstore/projectstore.h
@@ -65,7 +65,6 @@ class ProjectStore : public RefCounted, public GcStorage, public GcContributor,
public:
struct Configuration
{
- bool StoreAttachmentMetaData = false;
};
ProjectStore(CidStore& Store, std::filesystem::path BasePath, GcManager& Gc, JobQueue& JobQueue, const Configuration& Config);
diff --git a/src/zenserver/zenserver.cpp b/src/zenserver/zenserver.cpp
index 3c5d46a33..8d8da29b5 100644
--- a/src/zenserver/zenserver.cpp
+++ b/src/zenserver/zenserver.cpp
@@ -232,12 +232,7 @@ ZenServer::Initialize(const ZenServerOptions& ServerOptions, ZenServerState::Zen
ZEN_INFO("instantiating project service");
- m_ProjectStore =
- new ProjectStore(*m_CidStore,
- m_DataRoot / "projects",
- m_GcManager,
- *m_JobQueue,
- ProjectStore::Configuration{.StoreAttachmentMetaData = ServerOptions.ProjectStoreConfig.StoreAttachmentMetaData});
+ m_ProjectStore = new ProjectStore(*m_CidStore, m_DataRoot / "projects", m_GcManager, *m_JobQueue, ProjectStore::Configuration{});
m_HttpProjectService.reset(new HttpProjectService{*m_CidStore, m_ProjectStore, m_StatsService, *m_AuthMgr});
if (ServerOptions.WorksSpacesConfig.Enabled)
@@ -519,8 +514,6 @@ ZenServer::InitializeStructuredCache(const ZenServerOptions& ServerOptions)
Config.NamespaceConfig.DiskLayerConfig.MemCacheTargetFootprintBytes = ServerOptions.StructuredCacheConfig.MemTargetFootprintBytes;
Config.NamespaceConfig.DiskLayerConfig.MemCacheTrimIntervalSeconds = ServerOptions.StructuredCacheConfig.MemTrimIntervalSeconds;
Config.NamespaceConfig.DiskLayerConfig.MemCacheMaxAgeSeconds = ServerOptions.StructuredCacheConfig.MemMaxAgeSeconds;
- Config.NamespaceConfig.DiskLayerConfig.BucketConfig.StoreAttachmentMetaData =
- ServerOptions.StructuredCacheConfig.StoreAttachmentMetaData;
if (ServerOptions.IsDedicated)
{
diff --git a/src/zenstore/cache/cachedisklayer.cpp b/src/zenstore/cache/cachedisklayer.cpp
index 3fc4eca03..b67e8a570 100644
--- a/src/zenstore/cache/cachedisklayer.cpp
+++ b/src/zenstore/cache/cachedisklayer.cpp
@@ -3676,20 +3676,21 @@ ZenCacheDiskLayer::CacheBucket::GetReferences(GcCtx& Ctx, bool StateIsAlreadyLoc
OutReferences.reserve(OutReferences.size() + InlineKeys.size() +
StandaloneKeys.size()); // Make space for at least one attachment per record
+ bool UseMetaData = Ctx.Settings.StoreCacheAttachmentMetaData;
+
for (const std::vector<std::size_t>& ChunkIndexes : InlineBlockChunkIndexes)
{
ZEN_ASSERT(!ChunkIndexes.empty());
uint32_t BlockIndex = InlineLocations[ChunkIndexes[0]].BlockIndex;
- if (!m_Configuration.StoreAttachmentMetaData ||
- !ReadAttachmentsFromMetaData(BlockIndex, InlineKeys, ChunkIndexes, OutReferences))
+ if (!UseMetaData || !ReadAttachmentsFromMetaData(BlockIndex, InlineKeys, ChunkIndexes, OutReferences))
{
std::vector<IoHash> Keys;
std::vector<uint32_t> AttachmentCounts;
size_t PrecachedReferencesStart = OutReferences.size();
size_t NextPrecachedReferencesStart = PrecachedReferencesStart;
- bool WriteMetaData = m_Configuration.StoreAttachmentMetaData && !m_BlockStore.IsWriting(BlockIndex);
+ bool WriteMetaData = UseMetaData && !m_BlockStore.IsWriting(BlockIndex);
if (WriteMetaData)
{
Keys.reserve(InlineLocations.size());
diff --git a/src/zenstore/gc.cpp b/src/zenstore/gc.cpp
index cde89421e..159b13af0 100644
--- a/src/zenstore/gc.cpp
+++ b/src/zenstore/gc.cpp
@@ -1705,6 +1705,8 @@ GcScheduler::AppendGCLog(std::string_view Id, GcClock::TimePoint StartTime, cons
Writer << "CompactBlockUsageThresholdPercent"sv << Settings.CompactBlockUsageThresholdPercent;
Writer << "AttachmentRangeMin"sv << Settings.AttachmentRangeMin;
Writer << "AttachmentRangeMax"sv << Settings.AttachmentRangeMin;
+ Writer << "ForceStoreCacheAttachmentMetaData"sv << Settings.StoreCacheAttachmentMetaData;
+ Writer << "ForceStoreProjectAttachmentMetaData"sv << Settings.StoreProjectAttachmentMetaData;
}
Writer.EndObject();
@@ -1901,7 +1903,10 @@ GcScheduler::SchedulerThread()
bool SingleThreaded = m_Config.SingleThreaded;
IoHash AttachmentRangeMin = IoHash::Zero;
IoHash AttachmentRangeMax = IoHash::Max;
- uint8_t NextAttachmentPassIndex =
+ bool StoreCacheAttachmentMetaData = m_Config.StoreCacheAttachmentMetaData;
+ bool StoreProjectAttachmentMetaData = m_Config.StoreProjectAttachmentMetaData;
+
+ uint8_t NextAttachmentPassIndex =
ComputeAttachmentRange(m_AttachmentPassIndex, m_Config.AttachmentPassCount, AttachmentRangeMin, AttachmentRangeMax);
bool DiskSpaceGCTriggered = false;
@@ -1947,6 +1952,14 @@ GcScheduler::SchedulerThread()
{
NextAttachmentPassIndex = m_AttachmentPassIndex;
}
+ if (TriggerParams.StoreCacheAttachmentMetaData.has_value())
+ {
+ StoreCacheAttachmentMetaData = TriggerParams.StoreCacheAttachmentMetaData.value();
+ }
+ if (TriggerParams.StoreProjectAttachmentMetaData.has_value())
+ {
+ StoreProjectAttachmentMetaData = TriggerParams.StoreProjectAttachmentMetaData.value();
+ }
DoGc = true;
}
@@ -2173,6 +2186,8 @@ GcScheduler::SchedulerThread()
SingleThreaded,
AttachmentRangeMin,
AttachmentRangeMax,
+ StoreCacheAttachmentMetaData,
+ StoreProjectAttachmentMetaData,
SilenceErrors);
if (!GcSuccess)
{
@@ -2274,6 +2289,8 @@ GcScheduler::CollectGarbage(const GcClock::TimePoint& CacheExpireTime,
bool SingleThreaded,
const IoHash& AttachmentRangeMin,
const IoHash& AttachmentRangeMax,
+ bool StoreCacheAttachmentMetaData,
+ bool StoreProjectAttachmentMetaData,
bool SilenceErrors)
{
ZEN_TRACE_CPU("GcScheduler::CollectGarbage");
@@ -2357,18 +2374,24 @@ GcScheduler::CollectGarbage(const GcClock::TimePoint& CacheExpireTime,
.CompactBlockUsageThresholdPercent = CompactBlockUsageThresholdPercent,
.DiskReservePath = m_Config.RootDirectory / "reserve.gc",
.AttachmentRangeMin = AttachmentRangeMin,
- .AttachmentRangeMax = AttachmentRangeMax};
+ .AttachmentRangeMax = AttachmentRangeMax,
+ .StoreCacheAttachmentMetaData = StoreCacheAttachmentMetaData,
+ .StoreProjectAttachmentMetaData = StoreProjectAttachmentMetaData};
auto AppendSettings = [](StringBuilderBase& SB, const GcSettings& Settings) {
SB.Append(
fmt::format(" GC small objects: {}\n", Settings.CollectSmallObjects ? "yes"sv : "no"sv));
SB.Append(fmt::format(" GC Cid store: {}\n", Settings.SkipCidDelete ? "no"sv : "yes"sv));
- if (!Settings.SkipCidDelete &&
- (Settings.AttachmentRangeMin != IoHash::Zero || Settings.AttachmentRangeMax != IoHash::Max))
+ if (!Settings.SkipCidDelete)
{
- SB.Append(fmt::format(" Attachment range: {}-{}\n",
- Settings.AttachmentRangeMin,
- Settings.AttachmentRangeMax));
+ if (Settings.AttachmentRangeMin != IoHash::Zero || Settings.AttachmentRangeMax != IoHash::Max)
+ {
+ SB.Append(fmt::format(" Attachment range: {}-{}\n",
+ Settings.AttachmentRangeMin,
+ Settings.AttachmentRangeMax));
+ }
+ SB.Append(fmt::format(" Cache attachment meta: {}\n", Settings.StoreCacheAttachmentMetaData));
+ SB.Append(fmt::format(" Porject attachment meta: {}\n", Settings.StoreProjectAttachmentMetaData));
}
SB.Append(fmt::format(" Cache cutoff time: {}\n", Settings.CacheExpireTime));
SB.Append(fmt::format(" Project store cutoff time: {}", Settings.ProjectStoreExpireTime));
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; }