From 1be386768951d1f4f117a82aa61d52518ebdff77 Mon Sep 17 00:00:00 2001 From: mrambacher Date: Mon, 29 Mar 2021 10:31:58 -0700 Subject: [PATCH] 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 --- tools/db_bench_tool.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index e994f8e9a..789c83566 100644 --- a/tools/db_bench_tool.cc +++ b/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; }