aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/config.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-08-12 17:36:41 +0200
committerGitHub Enterprise <[email protected]>2025-08-12 17:36:41 +0200
commit39e750f78b0944157f0179266b7593b2e492453f (patch)
tree658fb9723889e857a118e01c5934c85df55aa45e /src/zenserver/config.cpp
parent5.6.16-pre0 (diff)
downloadzen-39e750f78b0944157f0179266b7593b2e492453f.tar.xz
zen-39e750f78b0944157f0179266b7593b2e492453f.zip
add limitoverwrites option per bucket (#466)
- Feature: Added global zenserver option `--cache-bucket-limit-overwrites` controlling Whether to require policy flag pattern before allowing overwrites or not. Default `false` = overwrites always allowed - Feature: Add per bucket cache configuration option `limitoverwrites` (Lua options file only) cache = { bucket = { -- This is the default for all namespaces limitoverwrites = true }, buckets = { -- Here you can add matching per bucket name (matches accross namespaces) iostorecompression = { limitoverwrites = false }, }, }
Diffstat (limited to 'src/zenserver/config.cpp')
-rw-r--r--src/zenserver/config.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/zenserver/config.cpp b/src/zenserver/config.cpp
index d53bedad0..23bb3ad78 100644
--- a/src/zenserver/config.cpp
+++ b/src/zenserver/config.cpp
@@ -342,6 +342,7 @@ public:
Writer.WriteValue("payloadalignment", fmt::format("{}", BucketConfig.PayloadAlignment));
Writer.WriteValue("largeobjectthreshold", fmt::format("{}", BucketConfig.PayloadAlignment));
+ Writer.WriteValue("limitoverwrites", fmt::format("{}", BucketConfig.LimitOverwrites));
}
Writer.EndContainer();
}
@@ -397,6 +398,8 @@ public:
}
BucketConfig.LargeObjectThreshold = LargeObjectThreshold;
+ BucketConfig.LimitOverwrites = Bucket.value().get_or("limitoverwrites", BucketConfig.LimitOverwrites);
+
Value.push_back(std::make_pair(std::move(Name), BucketConfig));
}
}
@@ -518,7 +521,6 @@ ParseConfigFile(const std::filesystem::path& Path,
LuaOptions.AddOption("cache.enable"sv, ServerOptions.StructuredCacheConfig.Enabled);
LuaOptions.AddOption("cache.writelog"sv, ServerOptions.StructuredCacheConfig.WriteLogEnabled, "cache-write-log"sv);
LuaOptions.AddOption("cache.accesslog"sv, ServerOptions.StructuredCacheConfig.AccessLogEnabled, "cache-access-log"sv);
- LuaOptions.AddOption("cache.limitoverwrites"sv, ServerOptions.StructuredCacheConfig.LimitOverwrites, "cache-limit-overwrites"sv);
LuaOptions.AddOption("cache.memlayer.sizethreshold"sv,
ServerOptions.StructuredCacheConfig.BucketConfig.MemCacheSizeThreshold,
@@ -543,6 +545,9 @@ ParseConfigFile(const std::filesystem::path& Path,
LuaOptions.AddOption("cache.bucket.largeobjectthreshold"sv,
ServerOptions.StructuredCacheConfig.BucketConfig.LargeObjectThreshold,
"cache-bucket-largeobjectthreshold"sv);
+ LuaOptions.AddOption("cache.bucket.limitoverwrites"sv,
+ ServerOptions.StructuredCacheConfig.BucketConfig.LimitOverwrites,
+ "cache-bucket-limit-overwrites"sv);
////// cache.upstream
LuaOptions.AddOption("cache.upstream.policy"sv, ServerOptions.UpstreamCacheConfig.CachePolicy, "upstream-cache-policy"sv);
@@ -1061,13 +1066,6 @@ ParseCliOptions(int argc, char* argv[], ZenServerOptions& ServerOptions)
cxxopts::value<bool>(ServerOptions.StructuredCacheConfig.AccessLogEnabled)->default_value("false"),
"");
- options.add_option("cache",
- "",
- "cache-limit-overwrites",
- "Whether to require policy flag pattern before allowing overwrites",
- cxxopts::value<bool>(ServerOptions.StructuredCacheConfig.LimitOverwrites)->default_value("false"),
- "");
-
options.add_option(
"cache",
"",
@@ -1128,6 +1126,13 @@ ParseCliOptions(int argc, char* argv[], ZenServerOptions& ServerOptions)
cxxopts::value<uint64_t>(ServerOptions.StructuredCacheConfig.BucketConfig.MemCacheSizeThreshold)->default_value("1024"),
"");
+ options.add_option("cache",
+ "",
+ "cache-bucket-limit-overwrites",
+ "Whether to require policy flag pattern before allowing overwrites in cache bucket",
+ cxxopts::value<bool>(ServerOptions.StructuredCacheConfig.BucketConfig.LimitOverwrites)->default_value("false"),
+ "");
+
options.add_option("gc",
"",
"gc-cache-attachment-store",