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
This commit is contained in:
mrambacher 2021-03-29 10:31:58 -07:00 committed by Facebook GitHub Bot
parent 70e80c91b6
commit 1be3867689

View file

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