]> 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>
Wed, 15 Jul 2020 16:35:34 +0000 (18:35 +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/46552
Signed-off-by: Adam Kupczyk <akupczyk@redhat.com>
src/common/legacy_config_opts.h
src/common/options.cc
src/os/bluestore/BlueFS.cc

index b501f23881369ab59a93fc49404ad9e0150382e7..7e7b77ccfd6c3ef2f392505f41a51c5e63ed72c8 100644 (file)
@@ -915,6 +915,7 @@ OPTION(bluefs_sync_write, OPT_BOOL)
 OPTION(bluefs_allocator, OPT_STR)     // stupid | bitmap
 OPTION(bluefs_log_replay_check_allocations, OPT_BOOL)
 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 119494e3adbcf6e519af66a0df98de225850ba19..4eb3cd892d03f75f7cc274b135f6e627fd80b1cd 100644 (file)
@@ -4046,6 +4046,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 0f231edc284d3a01afa41d0c19a8d579eee21fea..9e2556220d6c02687623a12463a5d04332c67b49 100644 (file)
@@ -2175,11 +2175,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);
+    }
   }
 }
 
@@ -3281,7 +3283,8 @@ void BlueFS::sync_metadata(bool avoid_compact)
 
 void BlueFS::_maybe_compact_log(std::unique_lock<ceph::mutex>& l)
 {
-  if (_should_compact_log()) {
+  if (!cct->_conf->bluefs_replay_recovery_disable_compact &&
+      _should_compact_log()) {
     if (cct->_conf->bluefs_compact_log_sync) {
       _compact_log_sync();
     } else {