db_bench should fail when an option uses an invalid compression type (#9729)
Summary: This changes db_bench to fail at startup for invalid compression types. It had been changing them to Snappy. For other invalid options it fails at startup. This is for https://github.com/facebook/rocksdb/issues/9621 Pull Request resolved: https://github.com/facebook/rocksdb/pull/9729 Test Plan: This continues to work: ./db_bench --benchmarks=fillrandom --compression_type=lz4 This now fails rather than changing the compression type to Snappy ./db_bench --benchmarks=fillrandom --compression_type=lz44 Cannot parse compression type 'lz44' Reviewed By: jay-zhuang Differential Revision: D35081323 Pulled By: mdcallag fbshipit-source-id: 9b38c835abddce11aa7feb235df63f53cf829981
This commit is contained in:
parent
91687d70ea
commit
6904fd0c86
@ -1148,9 +1148,10 @@ static enum ROCKSDB_NAMESPACE::CompressionType StringToCompressionType(
|
|||||||
return ROCKSDB_NAMESPACE::kXpressCompression;
|
return ROCKSDB_NAMESPACE::kXpressCompression;
|
||||||
else if (!strcasecmp(ctype, "zstd"))
|
else if (!strcasecmp(ctype, "zstd"))
|
||||||
return ROCKSDB_NAMESPACE::kZSTD;
|
return ROCKSDB_NAMESPACE::kZSTD;
|
||||||
|
else {
|
||||||
fprintf(stdout, "Cannot parse compression type '%s'\n", ctype);
|
fprintf(stderr, "Cannot parse compression type '%s'\n", ctype);
|
||||||
return ROCKSDB_NAMESPACE::kSnappyCompression; // default value
|
exit(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::string ColumnFamilyName(size_t i) {
|
static std::string ColumnFamilyName(size_t i) {
|
||||||
|
Loading…
Reference in New Issue
Block a user