]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: introduce bluestore_rocksdb_options_annex config parameter. 39325/head
authorIgor Fedotov <ifedotov@suse.com>
Mon, 21 Dec 2020 21:01:52 +0000 (00:01 +0300)
committerIgor Fedotov <ifedotov@suse.com>
Wed, 17 Feb 2021 09:20:06 +0000 (12:20 +0300)
This simplifies modifying a subset of rocksdb settings since it
eliminates the need to re-provide bluestore's rocksdb settings.

Signed-off-by: Igor Fedotov <ifedotov@suse.com>
(cherry picked from commit 711505e8f9effbf4f0ada3bfe8d25dbc7e86861e)

 Conflicts:
  (trivial) PendingReleaseNotes
  (trivial) src/common/options.cc
  (trivial) src/os/bluestore/BlueStore.cc

PendingReleaseNotes
src/common/legacy_config_opts.h
src/common/options.cc
src/os/bluestore/BlueStore.cc

index 508bc63cafd6a132a18bb5d0e7ae937721206117..0cd6c40da3f10fdc187aa861e05b11af9154d9c0 100644 (file)
@@ -6,6 +6,10 @@
   This improves out of the box performance of Ceph by allowing more PGs 
   to be created for a given pool.
 
+* New bluestore_rocksdb_options_annex config parameter. Complements
+  bluestore_rocksdb_options and allows setting rocksdb options without repeating
+  the existing defaults.
+
 15.2.8
 ------
 * $pid expansion in config paths like `admin_socket` will now properly expand
index 68364bbb96263b4f2abe826c0ec3a9dd3f4b89ae..3abaf52bb9e569f92276ebab181019886fa5dcbb 100644 (file)
@@ -1014,6 +1014,7 @@ OPTION(bluestore_bitmapallocator_span_size, OPT_INT) // must be power of 2 align
 OPTION(bluestore_max_deferred_txc, OPT_U64)
 OPTION(bluestore_max_defer_interval, OPT_U64)
 OPTION(bluestore_rocksdb_options, OPT_STR)
+OPTION(bluestore_rocksdb_options_annex, OPT_STR)
 OPTION(bluestore_fsck_on_mount, OPT_BOOL)
 OPTION(bluestore_fsck_on_mount_deep, OPT_BOOL)
 OPTION(bluestore_fsck_quick_fix_on_mount, OPT_BOOL)
index 693ed4c5f89345a8382cd178003a2b3af3f4ca60..165aa6f6453db1a9b93fd003aa1215c40e37d62f 100644 (file)
@@ -4434,7 +4434,11 @@ std::vector<Option> get_global_options() {
 
     Option("bluestore_rocksdb_options", Option::TYPE_STR, Option::LEVEL_ADVANCED)
     .set_default("compression=kNoCompression,max_write_buffer_number=4,min_write_buffer_number_to_merge=1,recycle_log_file_num=4,write_buffer_size=268435456,writable_file_max_buffer_size=0,compaction_readahead_size=2097152,max_background_compactions=2")
-    .set_description("Rocksdb options"),
+    .set_description("Full set of rocksdb settings to override"),
+
+    Option("bluestore_rocksdb_options_annex", Option::TYPE_STR, Option::LEVEL_ADVANCED)
+    .set_default("")
+    .set_description("An addition to bluestore_rocksdb_options. Allows setting rocksdb options without repeating the existing defaults."),
 
     Option("bluestore_rocksdb_cf", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
     .set_default(false)
index 2425580ceebf827177e13fc070f1c3e0aa1590dc..48e2f11df574794b1c48b152d75357fc21158e08 100644 (file)
@@ -5771,6 +5771,14 @@ int BlueStore::_open_bluefs(bool create)
   if (bluefs_layout.shared_bdev == BlueFS::BDEV_SLOW) {
 
     string options = cct->_conf->bluestore_rocksdb_options;
+    string options_annex = cct->_conf->bluestore_rocksdb_options_annex;
+    if (!options_annex.empty()) {
+      if (!options.empty() &&
+        *options.rbegin() != ',') {
+        options += ',';
+      }
+      options += options_annex;
+    }
 
     rocksdb::Options rocks_opts;
     int r = RocksDBStore::ParseOptionsFromStringStatic(
@@ -5973,6 +5981,7 @@ int BlueStore::_open_db(bool create, bool to_repair_db, bool read_only)
   ceph_assert(!(create && read_only));
   string fn = path + "/db";
   string options;
+  string options_annex;
   stringstream err;
   std::shared_ptr<Int64ArrayMergeOperator> merge_op(new Int64ArrayMergeOperator);
 
@@ -6121,6 +6130,14 @@ int BlueStore::_open_db(bool create, bool to_repair_db, bool read_only)
 
   if (kv_backend == "rocksdb") {
     options = cct->_conf->bluestore_rocksdb_options;
+    options_annex = cct->_conf->bluestore_rocksdb_options_annex;
+    if (!options_annex.empty()) {
+      if (!options.empty() &&
+        *options.rbegin() != ',') {
+        options += ',';
+      }
+      options += options_annex;
+    }
 
     map<string,string> cf_map;
     cct->_conf.with_val<string>("bluestore_rocksdb_cfs",