From ce3a1ca56df917bc3fa186d0e8c7b4256d2a37e9 Mon Sep 17 00:00:00 2001 From: Jianpeng Ma Date: Fri, 10 Jan 2020 14:33:55 +0800 Subject: [PATCH] kv/RocksDBStore: make options compaction_threads/disableWAL/flusher_threads/compact_on_mount work. This bug introduce by commit: 5f72c376deb64562e. Signed-off-by: Jianpeng Ma --- src/kv/RocksDBStore.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/kv/RocksDBStore.cc b/src/kv/RocksDBStore.cc index ab6edb70aeb..c68a72b22b9 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; -- 2.39.5