aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/storage/cache/httpstructuredcache.cpp
diff options
context:
space:
mode:
authorzousar <[email protected]>2025-12-19 00:49:38 -0700
committerzousar <[email protected]>2025-12-19 00:49:38 -0700
commit774d39bf193dd84b76437abcd41df2478e3431c0 (patch)
treeaf6550d5f2f0e292775843473260df1e2872e63a /src/zenserver/storage/cache/httpstructuredcache.cpp
parentChange default limit-overwrite behavior to true (diff)
downloadzen-774d39bf193dd84b76437abcd41df2478e3431c0.tar.xz
zen-774d39bf193dd84b76437abcd41df2478e3431c0.zip
Ensure upstream put propagation includes overwrite
When changing the default limit-overwrite behavior, a unit test surfaced a bug where an put of data with overwrite cache policy would not get propagated via zen's built-in upstream mechanism with a matching overwrite cache policy to the upstream. This change ensures that it does and leaves the unit test configured to exercise this scenario.
Diffstat (limited to 'src/zenserver/storage/cache/httpstructuredcache.cpp')
-rw-r--r--src/zenserver/storage/cache/httpstructuredcache.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/zenserver/storage/cache/httpstructuredcache.cpp b/src/zenserver/storage/cache/httpstructuredcache.cpp
index 03d2140a1..72f29d14e 100644
--- a/src/zenserver/storage/cache/httpstructuredcache.cpp
+++ b/src/zenserver/storage/cache/httpstructuredcache.cpp
@@ -1268,7 +1268,8 @@ HttpStructuredCacheService::HandlePutCacheRecord(HttpServerRequest& Request, con
if (HasUpstream && EnumHasAllFlags(PolicyFromUrl, CachePolicy::StoreRemote))
{
- m_UpstreamCache.EnqueueUpstream({.Type = ContentType, .Namespace = Ref.Namespace, .Key = {Ref.BucketSegment, Ref.HashKey}});
+ m_UpstreamCache.EnqueueUpstream(
+ {.Type = ContentType, .Namespace = Ref.Namespace, .Key = {Ref.BucketSegment, Ref.HashKey}, .Overwrite = Overwrite});
}
ZEN_DEBUG("PUTCACHERECORD - '{}/{}/{}' {} '{}' in {}",
@@ -1347,7 +1348,8 @@ HttpStructuredCacheService::HandlePutCacheRecord(HttpServerRequest& Request, con
m_UpstreamCache.EnqueueUpstream({.Type = ZenContentType::kCbObject,
.Namespace = Ref.Namespace,
.Key = {Ref.BucketSegment, Ref.HashKey},
- .ValueContentIds = std::move(ValidAttachments)});
+ .ValueContentIds = std::move(ValidAttachments),
+ .Overwrite = Overwrite});
}
Request.WriteResponse(HttpResponseCode::Created);
@@ -1465,7 +1467,8 @@ HttpStructuredCacheService::HandlePutCacheRecord(HttpServerRequest& Request, con
m_UpstreamCache.EnqueueUpstream({.Type = ZenContentType::kCbPackage,
.Namespace = Ref.Namespace,
.Key = {Ref.BucketSegment, Ref.HashKey},
- .ValueContentIds = std::move(ValidAttachments)});
+ .ValueContentIds = std::move(ValidAttachments),
+ .Overwrite = Overwrite});
}
Request.WriteResponse(HttpResponseCode::Created);