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
This commit is contained in:
Siying Dong 2018-01-29 14:13:05 -08:00 committed by Facebook Github Bot
parent b8eb32f8cf
commit e2d4b0efb1

View File

@ -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;