db_bench should fail on bad values for --compaction_fadvice and --value_size_distribution_type (#9741)

Summary:
db_bench quietly parses and ignores bad values for --compaction_fadvice and --value_size_distribution_type
I prefer that it fail for them as it does for bad option values in most other cases. Otherwise a benchmark
result will be provided for the wrong configuration and the result will be misleading.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/9741

Test Plan:
These now fail:
./db_bench --compaction_fadvice=noney
Unknown compaction fadvice:noney

./db_bench --value_size_distribution_type=norma
Cannot parse distribution type 'norma'

While correct values continue to work:
 ./db_bench --value_size_distribution_type=normal
Initializing RocksDB Options from the specified file
Initializing RocksDB Options from command-line flags

./db_bench --compaction_fadvice=none
Initializing RocksDB Options from the specified file
Initializing RocksDB Options from command-line flags

Reviewed By: siying

Differential Revision: D35115973

Pulled By: mdcallag

fbshipit-source-id: c2b10de5c2d1ea7c7539e676f5bd556351f5d370
main
Mark Callaghan 3 years ago committed by Facebook GitHub Bot
parent 862304a1fc
commit f219e3d5d8
  1. 3
      tools/db_bench_tool.cc

@ -1644,7 +1644,7 @@ static enum DistributionType StringToDistributionType(const char* ctype) {
return kNormal;
fprintf(stdout, "Cannot parse distribution type '%s'\n", ctype);
return kFixed; // default value
exit(1);
}
class BaseDistribution {
@ -8119,6 +8119,7 @@ int db_bench_tool(int argc, char** argv) {
else {
fprintf(stdout, "Unknown compaction fadvice:%s\n",
FLAGS_compaction_fadvice.c_str());
exit(1);
}
FLAGS_value_size_distribution_type_e =

Loading…
Cancel
Save