From e6a82b1438dce4e62f605ee74cf8e1d6c932d59c Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Thu, 27 Apr 2023 14:18:18 +0200 Subject: bugfixes (#261) * Don't try to GC if now blocks to GC was found, regardless if we have locations in memory * Don't let exception leak from scope guard as throw in destructor will abort application * changelog --- zenstore/blockstore.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'zenstore/blockstore.cpp') diff --git a/zenstore/blockstore.cpp b/zenstore/blockstore.cpp index 2894244fe..9738df729 100644 --- a/zenstore/blockstore.cpp +++ b/zenstore/blockstore.cpp @@ -353,6 +353,11 @@ BlockStore::ReclaimSpace(const ReclaimSnapshotState& Snapshot, }); size_t BlockCount = Snapshot.BlockCount; + if (BlockCount == 0) + { + ZEN_DEBUG("garbage collect for '{}' SKIPPED, no blocks to process", m_BlocksBasePath); + return; + } std::unordered_set KeepChunkMap; KeepChunkMap.reserve(KeepChunkIndexes.size()); -- cgit v1.2.3