aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2024-08-15 16:24:35 +0200
committerGitHub Enterprise <[email protected]>2024-08-15 16:24:35 +0200
commit20b2f7109cd594493a0cb832855afb12a4fc6fd2 (patch)
tree3a2c36d9f64016c14b528aed66609d927a7efe9e /src
parent5.5.4-pre2 (diff)
downloadzen-20b2f7109cd594493a0cb832855afb12a4fc6fd2.tar.xz
zen-20b2f7109cd594493a0cb832855afb12a4fc6fd2.zip
prevent new block in gc (#118)
* make sure we don't reset write-pos for new block for each block iterated
Diffstat (limited to 'src')
-rw-r--r--src/zenstore/blockstore.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/zenstore/blockstore.cpp b/src/zenstore/blockstore.cpp
index 09f55af0e..70ddcedaf 100644
--- a/src/zenstore/blockstore.cpp
+++ b/src/zenstore/blockstore.cpp
@@ -1263,6 +1263,7 @@ BlockStore::CompactBlocks(const BlockStoreCompactState& CompactState,
uint64_t RemovedSize = 0;
Ref<BlockStoreFile> NewBlockFile;
+ uint64_t WriteOffset = m_MaxBlockSize + 1u; // Force detect a new block
std::unique_ptr<BasicFileWriter> TargetFileBuffer;
auto NewBlockFileGuard = MakeGuard([&]() {
TargetFileBuffer.reset();
@@ -1352,7 +1353,6 @@ BlockStore::CompactBlocks(const BlockStoreCompactState& CompactState,
});
BasicFileBuffer SourceFileBuffer(OldBlockFile->GetBasicFile(), Min(65536u, OldBlockSize));
- uint64_t WriteOffset = m_MaxBlockSize + 1u; // Force detect a new block
uint64_t WrittenBytesToBlock = 0;
uint64_t MovedFromBlock = 0;
std::vector<uint8_t> Chunk;