From e2d4b0efb123a12a410adc078b614ad559b1a966 Mon Sep 17 00:00:00 2001 From: Siying Dong Date: Mon, 29 Jan 2018 14:13:05 -0800 Subject: [PATCH] db_bench: sanity check CuckooTable with mmap_read option Summary: This is to avoid run time error. Fail the db_bench immediately if cuckoo table is used but mmap_read is not specified. Closes https://github.com/facebook/rocksdb/pull/3420 Differential Revision: D6838284 Pulled By: siying fbshipit-source-id: 20893fa28d40fadc31e4ff154bed02f5a1bad341 --- tools/db_bench_tool.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index 177a4aeea..28807eea9 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -3069,6 +3069,12 @@ void VerifyDBFromDB(std::string& truth_db_name) { fprintf(stderr, "Invalid cuckoo_hash_ratio\n"); exit(1); } + + if (!FLAGS_mmap_read) { + fprintf(stderr, "cuckoo table format requires mmap read to operate\n"); + exit(1); + } + rocksdb::CuckooTableOptions table_options; table_options.hash_table_ratio = FLAGS_cuckoo_hash_ratio; table_options.identity_as_first_hash = FLAGS_identity_as_first_hash; -- GitLab