diff options
| author | Dan Engelbrecht <[email protected]> | 2023-05-11 09:03:45 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-05-11 09:03:45 +0200 |
| commit | b784282c11da2da8eb9002ef320496bbffecaf1a (patch) | |
| tree | 81dec40f623926055c5f09c134c67ef76ac1c28f | |
| parent | changelog (diff) | |
| download | zen-b784282c11da2da8eb9002ef320496bbffecaf1a.tar.xz zen-b784282c11da2da8eb9002ef320496bbffecaf1a.zip | |
if a block is missing during gc, log an error but still continue (#289)
| -rw-r--r-- | src/zenstore/blockstore.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/zenstore/blockstore.cpp b/src/zenstore/blockstore.cpp index 378d9fd52..0593ff06b 100644 --- a/src/zenstore/blockstore.cpp +++ b/src/zenstore/blockstore.cpp @@ -481,10 +481,14 @@ BlockStore::ReclaimSpace(const ReclaimSnapshotState& Snapshot, if (!OldBlockFile) { // If the block file pointed to does not exist, move them all to deleted list - BlockDeleteChunks[ChunkMapIndex].insert(BlockDeleteChunks[ChunkMapIndex].end(), - BlockKeepChunks[ChunkMapIndex].begin(), - BlockKeepChunks[ChunkMapIndex].end()); - BlockKeepChunks[ChunkMapIndex].clear(); + ChunkIndexArray& KeepMap = BlockKeepChunks[ChunkMapIndex]; + ZEN_ERROR("Expected to find block {} in {} - this should never happen, marking {} entries as deleted.", + BlockIndex, + m_BlocksBasePath, + KeepMap.size()); + + BlockDeleteChunks[ChunkMapIndex].insert(BlockDeleteChunks[ChunkMapIndex].end(), KeepMap.begin(), KeepMap.end()); + KeepMap.clear(); } const ChunkIndexArray& KeepMap = BlockKeepChunks[ChunkMapIndex]; |