From 3dfd38c8837c513cb3a5eff576cf3590046bd31e Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Tue, 3 Sep 2024 19:40:54 +0200 Subject: oplog index snapshots (#140) - Feature: Added project store oplog index snapshots for faster opening of oplog - opening oplogs are roughly 10x faster --- src/zenstore/blockstore.cpp | 2 ++ src/zenstore/cache/structuredcachestore.cpp | 2 ++ src/zenstore/caslog.cpp | 4 ++-- src/zenstore/include/zenstore/caslog.h | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src/zenstore') diff --git a/src/zenstore/blockstore.cpp b/src/zenstore/blockstore.cpp index 287a3f7fa..e20888ae4 100644 --- a/src/zenstore/blockstore.cpp +++ b/src/zenstore/blockstore.cpp @@ -1143,6 +1143,8 @@ BlockStore::IterateBlock(std::span ChunkLocations, const IterateChunksLargeSizeCallback& LargeSizeCallback, uint64_t LargeSizeLimit) { + ZEN_TRACE_CPU("BlockStore::IterateBlock"); + if (InChunkIndexes.empty()) { return true; diff --git a/src/zenstore/cache/structuredcachestore.cpp b/src/zenstore/cache/structuredcachestore.cpp index 9981aa1eb..ac1db2a4e 100644 --- a/src/zenstore/cache/structuredcachestore.cpp +++ b/src/zenstore/cache/structuredcachestore.cpp @@ -1035,6 +1035,8 @@ ZenCacheStore::GetBucketInfo(std::string_view NamespaceName, std::string_view Bu std::vector ZenCacheStore::LockState(GcCtx&) { + ZEN_TRACE_CPU("CacheStore::LockState"); + std::vector Locks; Locks.emplace_back(RwLock::SharedLockScope(m_NamespacesLock)); for (auto& NamespaceIt : m_Namespaces) diff --git a/src/zenstore/caslog.cpp b/src/zenstore/caslog.cpp index 2c26e522f..139456349 100644 --- a/src/zenstore/caslog.cpp +++ b/src/zenstore/caslog.cpp @@ -153,13 +153,13 @@ CasLogFile::Close() } uint64_t -CasLogFile::GetLogSize() +CasLogFile::GetLogSize() const { return m_File.FileSize(); } uint64_t -CasLogFile::GetLogCount() +CasLogFile::GetLogCount() const { uint64_t LogFileSize = m_AppendOffset.load(std::memory_order_acquire); if (LogFileSize < sizeof(FileHeader)) diff --git a/src/zenstore/include/zenstore/caslog.h b/src/zenstore/include/zenstore/caslog.h index d8c3f22f3..edb4f8d9b 100644 --- a/src/zenstore/include/zenstore/caslog.h +++ b/src/zenstore/include/zenstore/caslog.h @@ -26,8 +26,8 @@ public: void Replay(std::function&& Handler, uint64_t SkipEntryCount); void Flush(); void Close(); - uint64_t GetLogSize(); - uint64_t GetLogCount(); + uint64_t GetLogSize() const; + uint64_t GetLogCount() const; private: struct FileHeader -- cgit v1.2.3