From: Sage Weil Date: Wed, 30 Aug 2017 02:07:05 +0000 (-0400) Subject: os/bluestore/BlueFS: compact log even when sync_metadata sees no work X-Git-Tag: v12.2.14~6^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F34876%2Fhead;p=ceph.git os/bluestore/BlueFS: compact log even when sync_metadata sees no work It's possible that when sync_metadata() is called there won't be any new log data to flush because it was already flushed for other reasons (e.g., because fsync was called). However, the log may still be large and in need of compaction. Signed-off-by: Sage Weil (cherry picked from commit dfe5f05f7948da6200229248a41dc1368737380e) Conflicts: src/os/bluestore/BlueFS.cc Some pending release stuff that is now absent at both Luminous and master. --- diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index 230f677dbcd9..29224b2311af 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -2038,13 +2038,15 @@ void BlueFS::sync_metadata() std::unique_lock l(lock); if (log_t.empty()) { dout(10) << __func__ << " - no pending log events" << dendl; - return; + } else { + dout(10) << __func__ << dendl; + utime_t start = ceph_clock_now(); + flush_bdev(); // FIXME? + _flush_and_sync_log(l); + utime_t end = ceph_clock_now(); + utime_t dur = end - start; + dout(10) << __func__ << " done in " << dur << dendl; } - dout(10) << __func__ << dendl; - utime_t start = ceph_clock_now(); - flush_bdev(); // FIXME? - _flush_and_sync_log(l); - dout(10) << __func__ << " done in " << (ceph_clock_now() - start) << dendl; if (_should_compact_log()) { if (cct->_conf->bluefs_compact_log_sync) { @@ -2053,10 +2055,6 @@ void BlueFS::sync_metadata() _compact_log_async(l); } } - - utime_t end = ceph_clock_now(); - utime_t dur = end - start; - dout(10) << __func__ << " done in " << dur << dendl; } int BlueFS::open_for_write(