aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/include
diff options
context:
space:
mode:
authorzousar <[email protected]>2025-09-19 23:46:52 -0600
committerzousar <[email protected]>2025-09-19 23:46:52 -0600
commit7a94b22eafdbd3f394fb9200e713cbb3b2b0cd56 (patch)
tree2ff8345484208d100000d8be805ff8f13dd2e7cc /src/zenstore/include
parentfix quoted wildcard options (#500) (diff)
downloadzen-7a94b22eafdbd3f394fb9200e713cbb3b2b0cd56.tar.xz
zen-7a94b22eafdbd3f394fb9200e713cbb3b2b0cd56.zip
Change batch put responses for client reporting
Conflicts are now treated as successes, and we optionally return a Details array instead of an ErrorMessages array. Details are returned for all requests in a batch, or no requests in a batch depending on whether there are any details to be shared about any of the put requests. The details for a conflict include the raw hash and raw size of the item. If the item is a record, we also include the record as an object.
Diffstat (limited to 'src/zenstore/include')
-rw-r--r--src/zenstore/include/zenstore/cache/cachedisklayer.h3
-rw-r--r--src/zenstore/include/zenstore/cache/cacherpc.h4
2 files changed, 4 insertions, 3 deletions
diff --git a/src/zenstore/include/zenstore/cache/cachedisklayer.h b/src/zenstore/include/zenstore/cache/cachedisklayer.h
index 49c52f847..10c61681b 100644
--- a/src/zenstore/include/zenstore/cache/cachedisklayer.h
+++ b/src/zenstore/include/zenstore/cache/cachedisklayer.h
@@ -4,6 +4,7 @@
#include "cacheshared.h"
+#include <zencore/compactbinary.h>
#include <zencore/stats.h>
#include <zenstore/accesstime.h>
#include <zenstore/blockstore.h>
@@ -180,7 +181,7 @@ public:
struct PutResult
{
zen::PutStatus Status;
- std::string Message;
+ CbObject Details;
};
explicit ZenCacheDiskLayer(GcManager& Gc, JobQueue& JobQueue, const std::filesystem::path& RootDir, const Configuration& Config);
diff --git a/src/zenstore/include/zenstore/cache/cacherpc.h b/src/zenstore/include/zenstore/cache/cacherpc.h
index 104746aba..e0c8738ca 100644
--- a/src/zenstore/include/zenstore/cache/cacherpc.h
+++ b/src/zenstore/include/zenstore/cache/cacherpc.h
@@ -5,6 +5,7 @@
#include <zencore/iobuffer.h>
#include <zencore/logging.h>
#include <zenstore/cache/cacheshared.h>
+#include <zenstore/cache/structuredcachestore.h>
#include <zenutil/cache/cache.h>
#include <atomic>
@@ -28,7 +29,6 @@ class CidStore;
class DiskWriteBlocker;
class HttpStructuredCacheService;
class UpstreamCacheClient;
-class ZenCacheStore;
enum class CachePolicy : uint32_t;
enum class RpcAcceptOptions : uint16_t;
@@ -101,7 +101,7 @@ private:
CbPackage HandleRpcGetCacheValues(const CacheRequestContext& Context, CbObjectView BatchRequest);
CbPackage HandleRpcGetCacheChunks(const CacheRequestContext& Context, RpcAcceptOptions AcceptOptions, CbObjectView BatchRequest);
- PutStatus PutCacheRecord(PutRequestData& Request, const CbPackage* Package);
+ ZenCacheStore::PutResult PutCacheRecord(PutRequestData& Request, const CbPackage* Package);
/** HandleRpcGetCacheChunks Helper: Parse the Body object into RecordValue Requests and Value Requests. */
bool ParseGetCacheChunksRequest(std::string& Namespace,