aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/config.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2024-09-25 10:21:53 +0200
committerGitHub Enterprise <[email protected]>2024-09-25 10:21:53 +0200
commite27a5da5dae33f958a4b809a9e20a0af33c24f90 (patch)
tree3f22bdba794108fa2a4a4d5d1fc308a986b3483b /src/zenserver/config.cpp
parentexception safety when writing block (#168) (diff)
downloadzen-e27a5da5dae33f958a4b809a9e20a0af33c24f90.tar.xz
zen-e27a5da5dae33f958a4b809a9e20a0af33c24f90.zip
Add `gc-attachment-passes` option to zenserver (#167)
Added option `gc-attachment-passes` to zenserver Cleaned up GCv2 start and stop logs and added identifier to easily find matching start and end of a GC pass in log file Fixed project store not properly sorting references found during lock phase
Diffstat (limited to 'src/zenserver/config.cpp')
-rw-r--r--src/zenserver/config.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/zenserver/config.cpp b/src/zenserver/config.cpp
index 6c2bf40d8..2023a9d51 100644
--- a/src/zenserver/config.cpp
+++ b/src/zenserver/config.cpp
@@ -165,6 +165,11 @@ ValidateOptions(ZenServerOptions& ServerOptions)
{
throw zen::OptionParseException("Dedicated server can not be used with forced local server address");
}
+ if (ServerOptions.GcConfig.AttachmentPassCount > ZenGcConfig::GcMaxAttachmentPassCount)
+ {
+ throw zen::OptionParseException(
+ fmt::format("GC attachment pass count can not be larger than {}", ZenGcConfig::GcMaxAttachmentPassCount));
+ }
}
UpstreamCachePolicy
@@ -524,6 +529,7 @@ ParseConfigFile(const std::filesystem::path& Path,
LuaOptions.AddOption("gc.projectstore.attachment.store"sv,
ServerOptions.ProjectStoreConfig.StoreAttachmentMetaData,
"gc-projectstore-attachment-store");
+ LuaOptions.AddOption("gc.attachment.passes"sv, ServerOptions.GcConfig.AttachmentPassCount, "gc-attachment-passes"sv);
////// gc
LuaOptions.AddOption("gc.cache.maxdurationseconds"sv, ServerOptions.GcConfig.Cache.MaxDurationSeconds, "gc-cache-duration-seconds"sv);
@@ -1015,6 +1021,14 @@ ParseCliOptions(int argc, char* argv[], ZenServerOptions& ServerOptions)
cxxopts::value<bool>(ServerOptions.GcConfig.SingleThreaded)->default_value("false"),
"");
+ options.add_option("gc",
+ "",
+ "gc-attachment-passes",
+ "Limit the range of unreferenced attachments included in GC check by breaking it into passes. Default is one pass "
+ "which includes all the attachments.",
+ cxxopts::value<uint16_t>(ServerOptions.GcConfig.AttachmentPassCount)->default_value("1"),
+ "");
+
options.add_option("objectstore",
"",
"objectstore-enabled",