]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore/BlueFS: prevent concurrent async compaction
authorSage Weil <sage@redhat.com>
Thu, 15 Sep 2016 15:37:11 +0000 (11:37 -0400)
committerSage Weil <sage@redhat.com>
Thu, 15 Sep 2016 15:37:11 +0000 (11:37 -0400)
Tried to fix this in dbe23c94c0074358380a40d47a417f7999920696
but got the condition wrong (log_flushing is for
normal fsync).

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueFS.cc

index 6761a8b9fcea0e23dbeff6eea70a93a6ca5a99f3..279a9d469c592fb0df3a2a11301fba005256034c 100644 (file)
@@ -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<std::mutex>& 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();