diff options
| author | Per Larsson <[email protected]> | 2021-11-30 15:04:05 +0100 |
|---|---|---|
| committer | Per Larsson <[email protected]> | 2021-11-30 15:04:05 +0100 |
| commit | 571b483cad2d8c97a04d1f3ccdb594eb7e4cf791 (patch) | |
| tree | 5e8004ed313ba8b5bd173045c79674edbf7ec6cd /zenserver/cache/structuredcachestore.cpp | |
| parent | Added CAS total size. (diff) | |
| download | zen-571b483cad2d8c97a04d1f3ccdb594eb7e4cf791.tar.xz zen-571b483cad2d8c97a04d1f3ccdb594eb7e4cf791.zip | |
Added CacheStore and CAS store sizes to status endpoint.
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) |