aboutsummaryrefslogtreecommitdiff
path: root/zenstore/cidstore.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2022-04-04 12:05:25 +0200
committerDan Engelbrecht <[email protected]>2022-04-04 12:05:25 +0200
commit605b4f330eed43b14135f37ffb58c14fa1cd79c2 (patch)
treee8c99f26abb0634ecf53afe76cebd6f0c05742ca /zenstore/cidstore.cpp
parentlogging cleanup (diff)
downloadzen-605b4f330eed43b14135f37ffb58c14fa1cd79c2.tar.xz
zen-605b4f330eed43b14135f37ffb58c14fa1cd79c2.zip
always keep full log but read from index snapshot location if available
Diffstat (limited to 'zenstore/cidstore.cpp')
-rw-r--r--zenstore/cidstore.cpp36
1 files changed, 19 insertions, 17 deletions
diff --git a/zenstore/cidstore.cpp b/zenstore/cidstore.cpp
index 482a89b9d..509d21abe 100644
--- a/zenstore/cidstore.cpp
+++ b/zenstore/cidstore.cpp
@@ -134,28 +134,30 @@ struct CidStore::Impl
uint64_t TombstoneCount = 0;
uint64_t InvalidCount = 0;
- m_LogFile.Replay([&](const IndexEntry& Entry) {
- if (Entry.Compressed != IoHash::Zero)
- {
- // Update
- m_CidMap.insert_or_assign(Entry.Uncompressed, Entry.Compressed);
- }
- else
- {
- if (Entry.Uncompressed != IoHash::Zero)
+ m_LogFile.Replay(
+ [&](const IndexEntry& Entry) {
+ if (Entry.Compressed != IoHash::Zero)
{
- // Tombstone
- m_CidMap.erase(Entry.Uncompressed);
- ++TombstoneCount;
+ // Update
+ m_CidMap.insert_or_assign(Entry.Uncompressed, Entry.Compressed);
}
else
{
- // Completely uninitialized entry with both hashes set to zero indicates a
- // problem. Might be an unwritten page due to BSOD or some other problem
- ++InvalidCount;
+ if (Entry.Uncompressed != IoHash::Zero)
+ {
+ // Tombstone
+ m_CidMap.erase(Entry.Uncompressed);
+ ++TombstoneCount;
+ }
+ else
+ {
+ // Completely uninitialized entry with both hashes set to zero indicates a
+ // problem. Might be an unwritten page due to BSOD or some other problem
+ ++InvalidCount;
+ }
}
- }
- });
+ },
+ 0);
ZEN_INFO("CID index initialized: {} entries found ({} tombstones, {} invalid)", m_CidMap.size(), TombstoneCount, InvalidCount);
}