From ba22ffd43e646fe035f8457f3a89500c1cb1c120 Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Thu, 5 Oct 2023 16:03:14 +0200 Subject: check that block does not exists on disk before starting write to it (#449) * check that block does not exists on disk before starting write to it --- src/zenstore/include/zenstore/blockstore.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/zenstore/include') diff --git a/src/zenstore/include/zenstore/blockstore.h b/src/zenstore/include/zenstore/blockstore.h index 6fc0652f2..a2dea86c1 100644 --- a/src/zenstore/include/zenstore/blockstore.h +++ b/src/zenstore/include/zenstore/blockstore.h @@ -161,6 +161,8 @@ public: inline uint64_t TotalSize() const { return m_TotalSize.load(std::memory_order::relaxed); } private: + uint32_t GetFreeBlockIndex(uint32_t StartProbeIndex, RwLock::ExclusiveLockScope&, std::filesystem::path& OutBlockPath) const; + std::unordered_map> m_ChunkBlocks; mutable RwLock m_InsertLock; // used to serialize inserts -- cgit v1.2.3