From: Sage Weil Date: Thu, 15 Sep 2016 15:37:11 +0000 (-0400) Subject: os/bluestore/BlueFS: prevent concurrent async compaction X-Git-Tag: v11.0.1~226^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=455cc6cea2e5e8bc1126b5047b6003fa583af1b5;p=ceph.git 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 --- diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index 6761a8b9fce..279a9d469c5 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();