aboutsummaryrefslogtreecommitdiff
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
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
-rw-r--r--CHANGELOG.md1
-rw-r--r--src/zenstore/blockstore.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 43acb0abc..90d8341c5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@
- Bugfix: Report back error to http caller if removal of oplog fails
- Bugfix: If a cache bucket value fails validation - don't try to memcache the empty buffer
- Bugfix: Skip chunk in block stores when iterating a block if the location is out of range
+- Bugfix: Make sure we use the full max block size when compacting block store and not create a new block for each input block
- Improvement: `xmake run zenserver ...` now passes in `--detach=false` to allow subprocesses to be terminated using Ctrl-C (previously, zenserver instances would linger)
- Improvement: `zen workspace-share create` now resolves relative root paths to absolute paths
- Improvement: Add better output/logging when failing to initialize shared mutex
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;