diff --git a/db/log_and_apply_bench.cc b/db/log_and_apply_bench.cc index dbb459c30..a5aa95017 100644 --- a/db/log_and_apply_bench.cc +++ b/db/log_and_apply_bench.cc @@ -42,6 +42,11 @@ void BM_LogAndApply(int iters, int num_base_files) { Options options; EnvOptions sopt; + // Notice we are using the default options not through SanitizeOptions(). + // We might want to initialize some options manually if needed. + options.db_paths.emplace_back(dbname, 0); + // The parameter of table cache is passed in as null, so any file I/O + // operation is likely to fail. vset = new VersionSet(dbname, &options, sopt, nullptr); std::vector dummy; dummy.push_back(ColumnFamilyDescriptor()); diff --git a/util/ldb_cmd.cc b/util/ldb_cmd.cc index 8b92820de..b6e108ccc 100644 --- a/util/ldb_cmd.cc +++ b/util/ldb_cmd.cc @@ -556,6 +556,10 @@ void ManifestDumpCommand::DoCommand() { std::shared_ptr tc(NewLRUCache( options.max_open_files - 10, options.table_cache_numshardbits, options.table_cache_remove_scan_count_limit)); + // Notice we are using the default options not through SanitizeOptions(), + // if VersionSet::DumpManifest() depends on any option done by + // SanitizeOptions(), we need to initialize it manually. + options.db_paths.emplace_back("dummy", 0); VersionSet* versions = new VersionSet(dbname, &options, sopt, tc.get()); Status s = versions->DumpManifest(options, file, verbose_, is_key_hex_); if (!s.ok()) {