diff options
Diffstat (limited to 'zenserver/cache/structuredcachestore.cpp')
| -rw-r--r-- | zenserver/cache/structuredcachestore.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/zenserver/cache/structuredcachestore.cpp b/zenserver/cache/structuredcachestore.cpp index ed6b065b5..62c59a0ef 100644 --- a/zenserver/cache/structuredcachestore.cpp +++ b/zenserver/cache/structuredcachestore.cpp @@ -568,19 +568,21 @@ ZenCacheDiskLayer::CacheBucket::OpenOrCreate(std::filesystem::path BucketDir, bo if (RwLock::ExclusiveLockScope _(m_IndexLock); m_Index.empty()) { - m_SlogFile.Replay([&](const DiskIndexEntry& Record) { - if (Record.Key == IoHash::Zero) + m_SlogFile.Replay([&](const DiskIndexEntry& Entry) { + if (Entry.Key == IoHash::Zero) { ++InvalidEntryCount; - m_TotalSize.fetch_sub(Record.Location.Size()); + } + else if (Entry.Location.IsFlagSet(DiskLocation::kTombStone)) + { + m_TotalSize.fetch_sub(Entry.Location.Size()); } else { - m_Index[Record.Key] = Record.Location; - - MaxFileOffset = std::max<uint64_t>(MaxFileOffset, Record.Location.Offset() + Record.Location.Size()); - m_TotalSize.fetch_add(Record.Location.Size()); + m_Index[Entry.Key] = Entry.Location; + m_TotalSize.fetch_add(Entry.Location.Size()); } + MaxFileOffset = std::max<uint64_t>(MaxFileOffset, Entry.Location.Offset() + Entry.Location.Size()); }); if (InvalidEntryCount) |