From b8c099cf65ea972192d79afe95e339bc100cdb81 Mon Sep 17 00:00:00 2001 From: Igor Fedotov Date: Wed, 16 Mar 2022 12:44:33 +0300 Subject: [PATCH] os/bluestore: fix improper bluefs log size tracking in volume selector Fixes: https://tracker.ceph.com/issues/54554 Signed-off-by: Igor Fedotov --- src/os/bluestore/BlueFS.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index e9c5d7af835ee..f44347aa4c972 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -2409,6 +2409,9 @@ void BlueFS::_compact_log_async(std::unique_lock& l) dout(10) << __func__ << " remove 0x" << std::hex << old_log_jump_to << std::dec << " of " << log_file->fnode.extents << dendl; + + vselector->sub_usage(log_file->vselector_hint, log_file->fnode); + uint64_t discarded = 0; mempool::bluefs::vector old_extents; while (discarded < old_log_jump_to) { @@ -2437,8 +2440,6 @@ void BlueFS::_compact_log_async(std::unique_lock& l) ++from; } - vselector->sub_usage(log_file->vselector_hint, log_file->fnode); - // clear the extents from old log file, they are added to new log log_file->fnode.clear_extents(); // swap the log files. New log file is the log file now. -- 2.39.5