aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/include
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-08-12 17:23:19 +0200
committerGitHub Enterprise <[email protected]>2025-08-12 17:23:19 +0200
commit30bd2b7a618c4c9d1978d68c91e90ee388b48b24 (patch)
tree401b7fda2469dad9c0f5759c877965ecf52c1f8b /src/zenstore/include
parentuse new builds api for oplogs (#464) (diff)
downloadzen-30bd2b7a618c4c9d1978d68c91e90ee388b48b24.tar.xz
zen-30bd2b7a618c4c9d1978d68c91e90ee388b48b24.zip
reduce lock contention when checking for disk cache put reject (#465)
keep rawsize and rawhash if available when using batch for inline puts keep rawsize and rawhash of input value if we have calculated it for validation already
Diffstat (limited to 'src/zenstore/include')
-rw-r--r--src/zenstore/include/zenstore/cache/cachedisklayer.h24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/zenstore/include/zenstore/cache/cachedisklayer.h b/src/zenstore/include/zenstore/cache/cachedisklayer.h
index 023dd1ffa..ae5b2014d 100644
--- a/src/zenstore/include/zenstore/cache/cachedisklayer.h
+++ b/src/zenstore/include/zenstore/cache/cachedisklayer.h
@@ -396,20 +396,16 @@ public:
virtual std::vector<GcReferenceChecker*> CreateReferenceCheckers(GcCtx& Ctx) override;
virtual std::vector<GcReferenceValidator*> CreateReferenceValidators(GcCtx& Ctx) override;
- void BuildPath(PathBuilderBase& Path, const IoHash& HashKey) const;
- bool ShouldRejectPut(const IoHash& HashKey,
- const ZenCacheValue& Value,
- std::span<const IoHash> References,
- bool Overwrite,
- ZenCacheDiskLayer::PutResult& OutPutResult);
- void PutStandaloneCacheValue(const IoHash& HashKey, const ZenCacheValue& Value, std::span<IoHash> References);
- IoBuffer GetStandaloneCacheValue(const DiskLocation& Loc, const IoHash& HashKey) const;
- PutResult PutInlineCacheValue(const IoHash& HashKey,
- const ZenCacheValue& Value,
- std::span<IoHash> References,
- bool Overwrite,
- PutBatchHandle* OptionalBatchHandle = nullptr);
- IoBuffer GetInlineCacheValue(const DiskLocation& Loc) const;
+ void BuildPath(PathBuilderBase& Path, const IoHash& HashKey) const;
+ bool ShouldRejectPut(const IoHash& HashKey, ZenCacheValue& InOutValue, bool Overwrite, ZenCacheDiskLayer::PutResult& OutPutResult);
+ void PutStandaloneCacheValue(const IoHash& HashKey, const ZenCacheValue& Value, std::span<IoHash> References);
+ IoBuffer GetStandaloneCacheValue(const DiskLocation& Loc, const IoHash& HashKey) const;
+ PutResult PutInlineCacheValue(const IoHash& HashKey,
+ const ZenCacheValue& Value,
+ std::span<IoHash> References,
+ bool Overwrite,
+ PutBatchHandle* OptionalBatchHandle = nullptr);
+ IoBuffer GetInlineCacheValue(const DiskLocation& Loc) const;
CacheValueDetails::ValueDetails GetValueDetails(RwLock::SharedLockScope&, const IoHash& Key, PayloadIndex Index) const;
void SetMetaData(RwLock::ExclusiveLockScope&,