aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-08-06 17:00:51 +0200
committerGitHub Enterprise <[email protected]>2025-08-06 17:00:51 +0200
commit11d80722e209b14e132c0344f5cb10124d3fa8cb (patch)
tree08fc207d1b3b47ce726f8e05fb2807c20475d617
parentretry finalize if we get a "needs" on a blob we did not create (#461) (diff)
downloadzen-11d80722e209b14e132c0344f5cb10124d3fa8cb.tar.xz
zen-11d80722e209b14e132c0344f5cb10124d3fa8cb.zip
add the correct set of references hashes in batched inline mode (#459)
-rw-r--r--CHANGELOG.md1
-rw-r--r--src/zenstore/cache/cachedisklayer.cpp6
2 files changed, 4 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5e7569476..6cafaf839 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,7 @@
- Improvement: If cloud-ddc requests upload of a blob it earlier reported as good to reuse we treat it as a transient error and attempt to retry
- Bugfix: Parents were not notified when successfully attaching to an existing server instance
- Bugfix: BuildStorage cache return "true" for metadata existance for all blobs that had payloads regardless of actual existance for metadata
+- Bugfix: Add the referenced attachments correctly when storing inline cache bucket records using batch mode
## 5.6.14
- Improvement: If `zen builds upload` fails to upload metadata for a block with a 404 response (due to race condition from hitting different server) we save and retry metadata upload at end of upload
diff --git a/src/zenstore/cache/cachedisklayer.cpp b/src/zenstore/cache/cachedisklayer.cpp
index a5cab885f..fdf879e1f 100644
--- a/src/zenstore/cache/cachedisklayer.cpp
+++ b/src/zenstore/cache/cachedisklayer.cpp
@@ -1369,7 +1369,7 @@ ZenCacheDiskLayer::CacheBucket::EndPutBatch(PutBatchHandle* Batch) noexcept
{
DiskLocation Location(Locations[Index], m_Configuration.PayloadAlignment, EntryFlags[IndexOffset + Index]);
const std::vector<IoHash>& HashKeyAndReferences = Batch->Entries[IndexOffset + Index].HashKeyAndReferences;
- ZEN_ASSERT(HashKeyAndReferences.size() > 1);
+ ZEN_ASSERT(HashKeyAndReferences.size() >= 1);
const IoHash HashKey = HashKeyAndReferences[0];
DiskEntries.push_back({.Key = HashKey, .Location = Location});
if (m_TrackedCacheKeys)
@@ -2791,9 +2791,9 @@ ZenCacheDiskLayer::CacheBucket::PutInlineCacheValue(const IoHash& HashKey,
OptionalBatchHandle->EntryResultIndexes.push_back(OptionalBatchHandle->OutResults.size());
OptionalBatchHandle->OutResults.push_back(false);
std::vector<IoHash>& HashKeyAndReferences = OptionalBatchHandle->Entries.back().HashKeyAndReferences;
- HashKeyAndReferences.reserve(1 + HashKeyAndReferences.size());
+ HashKeyAndReferences.reserve(1 + References.size());
HashKeyAndReferences.push_back(HashKey);
- HashKeyAndReferences.insert(HashKeyAndReferences.end(), HashKeyAndReferences.begin(), HashKeyAndReferences.end());
+ HashKeyAndReferences.insert(HashKeyAndReferences.end(), References.begin(), References.end());
return;
}
uint8_t EntryFlags = 0;