]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: Add ability to disable compaction
authorAdam Kupczyk <akupczyk@redhat.com>
Fri, 26 Jun 2020 16:04:57 +0000 (18:04 +0200)
committerAdam Kupczyk <akupczyk@redhat.com>
Tue, 1 Sep 2020 14:49:18 +0000 (16:49 +0200)
This ability only makes sense as a step that allows to perform fsck before commiting recovered bluefs log.

Fixes: https://tracker.ceph.com/issues/46714
Signed-off-by: Adam Kupczyk <akupczyk@redhat.com>
Cherry-picked from 7b01af4d95bfa789b3b3247d016431fdbfd844a4
Conflicts:
src/os/bluestore/BlueFS.cc

src/common/legacy_config_opts.h
src/common/options.cc
src/os/bluestore/BlueFS.cc

index 405a683233968001da20d3d524a27b2fca31af1a..020889e9298585041779389404489a34b14bf792 100644 (file)
@@ -952,6 +952,7 @@ OPTION(bluefs_sync_write, OPT_BOOL)
 OPTION(bluefs_allocator, OPT_STR)     // stupid | bitmap
 OPTION(bluefs_preextend_wal_files, OPT_BOOL)  // this *requires* that rocksdb has recycling enabled
 OPTION(bluefs_replay_recovery, OPT_BOOL)
+OPTION(bluefs_replay_recovery_disable_compact, OPT_BOOL)
 
 OPTION(bluestore_bluefs, OPT_BOOL)
 OPTION(bluestore_bluefs_env_mirror, OPT_BOOL) // mirror to normal Env for debug
index 296ec00e6309c4789042d2a27b9497bc9e77f402..c7bd45881a688c2095fd71d7b8335205133b2126 100644 (file)
@@ -4383,6 +4383,10 @@ std::vector<Option> get_global_options() {
                          "This options enables heuristics that scans devices for missing data. "
                          "DO NOT ENABLE BY DEFAULT"),
 
+    Option("bluefs_replay_recovery_disable_compact", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
+    .set_default(false)
+    .set_description(""),
+
     Option("bluestore_bluefs", Option::TYPE_BOOL, Option::LEVEL_DEV)
     .set_default(true)
     .set_flag(Option::FLAG_CREATE)
index e2e1a00f5f7b1a89beadf3aad7fd32d13e8d516c..492adee220d6516e9f26d895ff6febab78bb3334 100644 (file)
@@ -1753,11 +1753,13 @@ uint64_t BlueFS::_estimate_log_size()
 
 void BlueFS::compact_log()
 {
-  std::unique_lock l(lock);
-  if (cct->_conf->bluefs_compact_log_sync) {
-     _compact_log_sync();
-  } else {
-    _compact_log_async(l);
+  std::unique_lock<ceph::mutex> l(lock);
+  if (!cct->_conf->bluefs_replay_recovery_disable_compact) {
+    if (cct->_conf->bluefs_compact_log_sync) {
+      _compact_log_sync();
+    } else {
+      _compact_log_async(l);
+    }
   }
 }
 
@@ -2845,7 +2847,9 @@ void BlueFS::sync_metadata(bool avoid_compact)
     dout(10) << __func__ << " done in " << (ceph_clock_now() - start) << dendl;
   }
 
-  if (!avoid_compact && _should_compact_log()) {
+  if (!avoid_compact &&
+      !cct->_conf->bluefs_replay_recovery_disable_compact &&
+      _should_compact_log()) {
     if (cct->_conf->bluefs_compact_log_sync) {
       _compact_log_sync();
     } else {