aboutsummaryrefslogtreecommitdiff
path: root/zenstore
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-09-19 23:30:37 +0200
committerStefan Boberg <[email protected]>2021-09-19 23:30:37 +0200
commit22fbe6e86bb6527c9a6214bf921f872cc27ee64c (patch)
tree581b66f2cacc97f116daaaa9e49d9e54c949c94a /zenstore
parentImplemented BasicFile::StreamByteRange (diff)
downloadzen-22fbe6e86bb6527c9a6214bf921f872cc27ee64c.tar.xz
zen-22fbe6e86bb6527c9a6214bf921f872cc27ee64c.zip
Implemented handling of "large" chunks in compact cas scrubbing
Diffstat (limited to 'zenstore')
-rw-r--r--zenstore/compactcas.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/zenstore/compactcas.cpp b/zenstore/compactcas.cpp
index 0f9349ab0..070ca1503 100644
--- a/zenstore/compactcas.cpp
+++ b/zenstore/compactcas.cpp
@@ -230,6 +230,16 @@ CasContainerStrategy::Scrub(ScrubContext& Ctx)
for (const CasDiskIndexEntry& Entry : BigChunks)
{
+ IoHashStream Hasher;
+ m_SmallObjectFile.StreamByteRange(Entry.Location.Offset, Entry.Location.Size, [&](const void* Data, uint64_t Size) {
+ Hasher.Append(Data, Size);
+ });
+ IoHash ComputedHash = Hasher.GetHash();
+
+ if (Entry.Key != ComputedHash)
+ {
+ BadChunks.push_back(Entry);
+ }
}
// Deal with bad chunks by removing them from our lookup map