]> git.apps.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>
Wed, 15 Jul 2020 20:04:27 +0000 (22:04 +0200)
This ability only makes sense as a step that allows to perform fsck before commiting recovered bluefs log.

Signed-off-by: Adam Kupczyk <akupczyk@redhat.com>
src/common/legacy_config_opts.h
src/common/options.cc
src/os/bluestore/BlueFS.cc

index da5d961dcccda90e35189d27abbc0c1373347658..9e2315362ebf9c4448d3fbd0676b8a800b1005aa 100644 (file)
@@ -996,6 +996,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 5c982c81e03707bb5ca6caaed142231772e52f08..a772ec02332ddf735201aba1fbae9fb41a556c6f 100644 (file)
@@ -3385,6 +3385,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)
     .add_tag("mkfs")
index b9ee408601ca3fc30016e21e666345e17d0feea1..2334725f2ffeed8e2cb1a8bfdcfa692346e064a0 100644 (file)
@@ -1182,10 +1182,12 @@ uint64_t BlueFS::_estimate_log_size()
 void BlueFS::compact_log()
 {
   std::unique_lock<std::mutex> l(lock);
-  if (cct->_conf->bluefs_compact_log_sync) {
-     _compact_log_sync();
-  } else {
-    _compact_log_async(l);
+  if (!cct->_conf->bluefs_replay_recovery_disable_compact) {
+    if (cct->_conf->bluefs_compact_log_sync) {
+      _compact_log_sync();
+    } else {
+      _compact_log_async(l);
+    }
   }
 }
 
@@ -2061,13 +2063,14 @@ void BlueFS::sync_metadata()
     utime_t end = ceph_clock_now();
     utime_t dur = end - start;
     dout(10) << __func__ << " done in " << dur << dendl;
-  }
-
-  if (_should_compact_log()) {
-    if (cct->_conf->bluefs_compact_log_sync) {
-      _compact_log_sync();
-    } else {
-      _compact_log_async(l);
+    if (!cct->_conf->bluefs_replay_recovery_disable_compact) {
+      if (_should_compact_log()) {
+       if (cct->_conf->bluefs_compact_log_sync) {
+         _compact_log_sync();
+       } else {
+         _compact_log_async(l);
+       }
+      }
     }
   }
 }