From 455cc6cea2e5e8bc1126b5047b6003fa583af1b5 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 15 Sep 2016 11:37:11 -0400 Subject: [PATCH] os/bluestore/BlueFS: prevent concurrent async compaction Tried to fix this in dbe23c94c0074358380a40d47a417f7999920696 but got the condition wrong (log_flushing is for normal fsync). Signed-off-by: Sage Weil --- src/os/bluestore/BlueFS.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index 6761a8b9fcea0..279a9d469c592 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -999,9 +999,9 @@ bool BlueFS::_should_compact_log() dout(10) << __func__ << " current 0x" << std::hex << current << " expected " << expected << std::dec << " ratio " << ratio - << (log_flushing ? " (async compaction in progress)" : "") + << (new_log ? " (async compaction in progress)" : "") << dendl; - if (log_flushing || + if (new_log || current < g_conf->bluefs_log_compact_min_size || ratio < g_conf->bluefs_log_compact_min_ratio) { return false; @@ -1122,6 +1122,8 @@ void BlueFS::_compact_log_async(std::unique_lock& l) { dout(10) << __func__ << dendl; File *log_file = log_writer->file.get(); + assert(!new_log); + assert(!new_log_writer); // 1. allocate new log space and jump to it. old_log_jump_to = log_file->fnode.get_allocated(); -- 2.39.5