]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kv/RocksDBStore: make options compaction_threads/disableWAL/flusher_threads/compact_o... 37055/head
authorJianpeng Ma <jianpeng.ma@intel.com>
Fri, 10 Jan 2020 06:33:55 +0000 (14:33 +0800)
committerIgor Fedotov <ifedotov@suse.com>
Tue, 8 Sep 2020 21:10:17 +0000 (00:10 +0300)
This bug introduce by commit: 5f72c376deb64562e.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
(cherry picked from commit ce3a1ca56df917bc3fa186d0e8c7b4256d2a37e9)

src/kv/RocksDBStore.cc

index 24c8384fd22c9ab9d7b65aa0b9f4a6db7976bc07..6c020a7456d75846ade06579868c6737542e90bc 100644 (file)
@@ -255,6 +255,9 @@ int RocksDBStore::ParseOptionsFromStringStatic(
   rocksdb::Options& opt,
   function<int(const string&, const string&, rocksdb::Options&)> interp)
 {
+  // keep aligned with func tryInterpret
+  const set<string> need_interp_keys = {"compaction_threads", "flusher_threads", "compact_on_mount", "disableWAL"};
+
   map<string, string> str_map;
   int r = get_str_map(opt_str, &str_map, ",\n;");
   if (r < 0)
@@ -265,7 +268,11 @@ int RocksDBStore::ParseOptionsFromStringStatic(
     rocksdb::Status status =
       rocksdb::GetOptionsFromString(opt, this_opt, &opt);
     if (!status.ok()) {
-      r = interp != nullptr ? interp(it->first, it->second, opt) : -1;
+      if (interp != nullptr) {
+       r = interp(it->first, it->second, opt);
+      } else if (!need_interp_keys.count(it->first)) {
+       r = -1;
+      }
       if (r < 0) {
         derr << status.ToString() << dendl;
         return -EINVAL;