aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/cache/cachedisklayer.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2024-09-30 09:59:34 +0200
committerGitHub Enterprise <[email protected]>2024-09-30 09:59:34 +0200
commitebec68d49b2c968ecf684973b33f9f3d1d56b702 (patch)
tree39de29b8d6b24d071d38254e40b5ee850b7c1299 /src/zenstore/cache/cachedisklayer.cpp
parentoptimize startup time (#175) (diff)
downloadzen-ebec68d49b2c968ecf684973b33f9f3d1d56b702.tar.xz
zen-ebec68d49b2c968ecf684973b33f9f3d1d56b702.zip
gc command attachment options (#176)
* zen command - add options to control meta data cache when triggering gc
Diffstat (limited to 'src/zenstore/cache/cachedisklayer.cpp')
-rw-r--r--src/zenstore/cache/cachedisklayer.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/zenstore/cache/cachedisklayer.cpp b/src/zenstore/cache/cachedisklayer.cpp
index 3fc4eca03..b67e8a570 100644
--- a/src/zenstore/cache/cachedisklayer.cpp
+++ b/src/zenstore/cache/cachedisklayer.cpp
@@ -3676,20 +3676,21 @@ ZenCacheDiskLayer::CacheBucket::GetReferences(GcCtx& Ctx, bool StateIsAlreadyLoc
OutReferences.reserve(OutReferences.size() + InlineKeys.size() +
StandaloneKeys.size()); // Make space for at least one attachment per record
+ bool UseMetaData = Ctx.Settings.StoreCacheAttachmentMetaData;
+
for (const std::vector<std::size_t>& ChunkIndexes : InlineBlockChunkIndexes)
{
ZEN_ASSERT(!ChunkIndexes.empty());
uint32_t BlockIndex = InlineLocations[ChunkIndexes[0]].BlockIndex;
- if (!m_Configuration.StoreAttachmentMetaData ||
- !ReadAttachmentsFromMetaData(BlockIndex, InlineKeys, ChunkIndexes, OutReferences))
+ if (!UseMetaData || !ReadAttachmentsFromMetaData(BlockIndex, InlineKeys, ChunkIndexes, OutReferences))
{
std::vector<IoHash> Keys;
std::vector<uint32_t> AttachmentCounts;
size_t PrecachedReferencesStart = OutReferences.size();
size_t NextPrecachedReferencesStart = PrecachedReferencesStart;
- bool WriteMetaData = m_Configuration.StoreAttachmentMetaData && !m_BlockStore.IsWriting(BlockIndex);
+ bool WriteMetaData = UseMetaData && !m_BlockStore.IsWriting(BlockIndex);
if (WriteMetaData)
{
Keys.reserve(InlineLocations.size());