diff options
| author | zousar <[email protected]> | 2025-09-19 23:46:52 -0600 |
|---|---|---|
| committer | zousar <[email protected]> | 2025-09-19 23:46:52 -0600 |
| commit | 7a94b22eafdbd3f394fb9200e713cbb3b2b0cd56 (patch) | |
| tree | 2ff8345484208d100000d8be805ff8f13dd2e7cc /src/zenstore/cache/structuredcachestore.cpp | |
| parent | fix quoted wildcard options (#500) (diff) | |
| download | zen-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/cache/structuredcachestore.cpp')
| -rw-r--r-- | src/zenstore/cache/structuredcachestore.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/zenstore/cache/structuredcachestore.cpp b/src/zenstore/cache/structuredcachestore.cpp index 3f27e6d21..51c80dbc7 100644 --- a/src/zenstore/cache/structuredcachestore.cpp +++ b/src/zenstore/cache/structuredcachestore.cpp @@ -730,7 +730,9 @@ ZenCacheStore::Put(const CacheRequestContext& Context, if (IsKnownBadBucketName(Bucket)) { m_RejectedWriteCount++; - return PutResult{zen::PutStatus::Invalid, "Bad bucket name"}; + CbObjectWriter DetailWriter; + DetailWriter.AddString("Bad bucket name"); + return PutResult{zen::PutStatus::Invalid, DetailWriter.Save()}; } ZEN_MEMSCOPE(GetCacheStoreTag()); @@ -777,7 +779,10 @@ ZenCacheStore::Put(const CacheRequestContext& Context, Namespace, Bucket, HashKey.ToHexString()); - return PutResult{zen::PutStatus::Fail, fmt::format("Unknown namespace '{}'", Namespace)}; + + CbObjectWriter DetailWriter; + DetailWriter.AddString(fmt::format("Unknown namespace '{}'", Namespace)); + return PutResult{zen::PutStatus::Fail, DetailWriter.Save()}; } bool |