aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/compactcas.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-05-30 11:51:05 +0200
committerGitHub Enterprise <[email protected]>2025-05-30 11:51:05 +0200
commit42aa2c9a8124ada33c88f5c608e4865b1ff84c64 (patch)
tree4c237a2e515f73a256ee290e8f9a113f0a2060f2 /src/zenstore/compactcas.cpp
parentfrequent disk space check (#407) (diff)
downloadzen-42aa2c9a8124ada33c88f5c608e4865b1ff84c64.tar.xz
zen-42aa2c9a8124ada33c88f5c608e4865b1ff84c64.zip
faster oplog validate (#408)
Improvement: Faster oplog validate to reduce GC wall time and disk I/O pressure
Diffstat (limited to 'src/zenstore/compactcas.cpp')
-rw-r--r--src/zenstore/compactcas.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/zenstore/compactcas.cpp b/src/zenstore/compactcas.cpp
index 15bea272b..730bdf143 100644
--- a/src/zenstore/compactcas.cpp
+++ b/src/zenstore/compactcas.cpp
@@ -307,7 +307,12 @@ bool
CasContainerStrategy::HaveChunk(const IoHash& ChunkHash)
{
RwLock::SharedLockScope _(m_LocationMapLock);
- return m_LocationMap.contains(ChunkHash);
+ if (auto KeyIt = m_LocationMap.find(ChunkHash); KeyIt != m_LocationMap.end())
+ {
+ const BlockStoreLocation& Location = m_Locations[KeyIt->second].Get(m_PayloadAlignment);
+ return m_BlockStore.HasChunk(Location);
+ }
+ return false;
}
void