aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/cache/structuredcachestore.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenserver/cache/structuredcachestore.cpp')
-rw-r--r--src/zenserver/cache/structuredcachestore.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/zenserver/cache/structuredcachestore.cpp b/src/zenserver/cache/structuredcachestore.cpp
index f7960f498..fe0b84f33 100644
--- a/src/zenserver/cache/structuredcachestore.cpp
+++ b/src/zenserver/cache/structuredcachestore.cpp
@@ -416,6 +416,14 @@ ZenCacheStore::Get(const CacheRequestContext& Context,
const IoHash& HashKey,
ZenCacheValue& OutValue)
{
+ // Ad hoc rejection of known bad usage patterns for DDC bucket names
+
+ if (IsKnownBadBucketName(Bucket))
+ {
+ m_RejectedReadCount++;
+ return false;
+ }
+
ZEN_TRACE_CPU("Z$::Get");
metrics::RequestStats::Scope OpScope(m_GetOps, 0);
@@ -470,10 +478,6 @@ ZenCacheStore::Put(const CacheRequestContext& Context,
const IoHash& HashKey,
const ZenCacheValue& Value)
{
- ZEN_TRACE_CPU("Z$::Put");
-
- metrics::RequestStats::Scope $(m_PutOps, Value.Value.GetSize());
-
// Ad hoc rejection of known bad usage patterns for DDC bucket names
if (IsKnownBadBucketName(Bucket))
@@ -482,6 +486,10 @@ ZenCacheStore::Put(const CacheRequestContext& Context,
return;
}
+ ZEN_TRACE_CPU("Z$::Put");
+
+ metrics::RequestStats::Scope $(m_PutOps, Value.Value.GetSize());
+
if (m_WriteLogEnabled)
{
ZEN_TRACE_CPU("Z$::Get::WriteLog");
@@ -690,6 +698,7 @@ ZenCacheStore::Stats()
.MissCount = m_MissCount,
.WriteCount = m_WriteCount,
.RejectedWriteCount = m_RejectedWriteCount,
+ .RejectedReadCount = m_RejectedReadCount,
.PutOps = m_PutOps.Snapshot(),
.GetOps = m_GetOps.Snapshot()};
IterateNamespaces([&](std::string_view NamespaceName, ZenCacheNamespace& Store) {