Skip to content

Commit

Permalink
kv/RocksDBStore: make options compaction_threads/disableWAL/flusher_t…
Browse files Browse the repository at this point in the history
…hreads/compact_on_mount work.

This bug introduce by commit: 5f72c37.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
  • Loading branch information
majianpeng committed Jan 10, 2020
1 parent cf2d411 commit ce3a1ca
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/kv/RocksDBStore.cc
Expand Up @@ -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)
Expand All @@ -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;
Expand Down

0 comments on commit ce3a1ca

Please sign in to comment.