From 685bcd6ef9617a994565bcdcbac6ceb9c1af2a47 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Wed, 21 Feb 2024 12:59:09 +0300 Subject: [PATCH] Do not reserve extra space for big_writes during sync - sync itself is needed to commit and clear them --- src/blockstore_sync.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/blockstore_sync.cpp b/src/blockstore_sync.cpp index 578e2dcc..5ba3d79b 100644 --- a/src/blockstore_sync.cpp +++ b/src/blockstore_sync.cpp @@ -76,7 +76,6 @@ int blockstore_impl_t::continue_sync(blockstore_op_t *op) // 2nd step: Data device is synced, prepare & write journal entries // Check space in the journal and journal memory buffers blockstore_journal_check_t space_check(this); - auto reservation = (unstable_writes.size()+unstable_unsynced+PRIV(op)->sync_big_writes.size())*journal.block_size; if (dsk.csum_block_size) { // More complex check because all journal entries have different lengths @@ -86,14 +85,14 @@ int blockstore_impl_t::continue_sync(blockstore_op_t *op) left--; auto & dirty_entry = dirty_db.at(sbw); uint64_t dyn_size = dsk.dirty_dyn_size(dirty_entry.offset, dirty_entry.len); - if (!space_check.check_available(op, 1, sizeof(journal_entry_big_write) + dyn_size, left ? 0 : reservation)) + if (!space_check.check_available(op, 1, sizeof(journal_entry_big_write) + dyn_size, 0)) { return 0; } } } else if (!space_check.check_available(op, PRIV(op)->sync_big_writes.size(), - sizeof(journal_entry_big_write) + dsk.clean_entry_bitmap_size, reservation)) + sizeof(journal_entry_big_write) + dsk.clean_entry_bitmap_size, 0)) { return 0; }