From 23b76252c8d89a6780c51ac799626cd9f7fb6299 Mon Sep 17 00:00:00 2001 From: Zhongyi Xie Date: Fri, 13 Jul 2018 16:27:37 -0700 Subject: [PATCH] db_bench: enable setting cache_size when loading options file Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/4118 Differential Revision: D8845554 Pulled By: miasantreble fbshipit-source-id: 13bd3c1259a7c30bad762a413fe3bb24eea650ba --- tools/db_bench_tool.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index 7c6fb162a..7da52daa6 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -3390,6 +3390,16 @@ void VerifyDBFromDB(std::string& truth_db_name) { options.compression_opts.max_dict_bytes = FLAGS_compression_max_dict_bytes; options.compression_opts.zstd_max_train_bytes = FLAGS_compression_zstd_max_train_bytes; + if (FLAGS_cache_size) { + // If this is a block based table, also need to set block_cache + if (options.table_factory->Name() == BlockBasedTableFactory::kName && + options.table_factory->GetOptions() != nullptr) { + BlockBasedTableOptions* table_options = + reinterpret_cast( + options.table_factory->GetOptions()); + table_options->block_cache = cache_; + } + } if (FLAGS_row_cache_size) { if (FLAGS_cache_numshardbits >= 1) { options.row_cache =