Fix check in db_bench for num shard bits to match check in LRUCache (#8110)

Summary:
The check in db_bench for table_cache_numshardbits was 0 < bits <= 20, whereas the check in LRUCache was 0 < bits < 20.  Changed the two values to match to avoid a crash in db_bench on a null cache.

Fixes https://github.com/facebook/rocksdb/issues/7393

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

Reviewed By: zhichao-cao

Differential Revision: D27353522

Pulled By: mrambacher

fbshipit-source-id: a414bd23b5bde1f071146b34cfca5e35c02de869
main
mrambacher 4 years ago committed by Facebook GitHub Bot
parent 70e80c91b6
commit 1be3867689
  1. 4
      tools/db_bench_tool.cc

@ -1008,8 +1008,8 @@ DEFINE_uint64(compression_max_dict_buffer_bytes,
static bool ValidateTableCacheNumshardbits(const char* flagname,
int32_t value) {
if (0 >= value || value > 20) {
fprintf(stderr, "Invalid value for --%s: %d, must be 0 < val <= 20\n",
if (0 >= value || value >= 20) {
fprintf(stderr, "Invalid value for --%s: %d, must be 0 < val < 20\n",
flagname, value);
return false;
}

Loading…
Cancel
Save