From: Jianpeng Ma Date: Fri, 10 Jan 2020 06:33:55 +0000 (+0800) Subject: kv/RocksDBStore: make options compaction_threads/disableWAL/flusher_threads/compact_o... X-Git-Tag: v15.1.0~202^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F32453%2Fhead;p=ceph.git kv/RocksDBStore: make options compaction_threads/disableWAL/flusher_threads/compact_on_mount work. This bug introduce by commit: 5f72c376deb64562e. Signed-off-by: Jianpeng Ma --- diff --git a/src/kv/RocksDBStore.cc b/src/kv/RocksDBStore.cc index ab6edb70aeba7..c68a72b22b996 100644 --- a/src/kv/RocksDBStore.cc +++ b/src/kv/RocksDBStore.cc @@ -255,6 +255,9 @@ int RocksDBStore::ParseOptionsFromStringStatic( rocksdb::Options& opt, function interp) { + // keep aligned with func tryInterpret + const set need_interp_keys = {"compaction_threads", "flusher_threads", "compact_on_mount", "disableWAL"}; + map 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;