From d3d5f03b8c43a40384a3b13e28854a55f0df6003 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 11 Jan 2019 16:35:52 -0800 Subject: [PATCH] ircd::db: Ensure no internal block cache is created by rocksdb when do not want. --- ircd/db.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ircd/db.cc b/ircd/db.cc index 58183f595..f6bcb6a85 100644 --- a/ircd/db.cc +++ b/ircd/db.cc @@ -1795,6 +1795,14 @@ ircd::db::database::column::column(database &d, if(cache_size != 0) table_opts.block_cache = std::make_shared(this->d, this->stats, this->name, cache_size); + // RocksDB will create an 8_MiB block_cache if we don't create our own. + // To honor the user's desire for a zero-size cache, this must be set. + if(!table_opts.block_cache) + { + table_opts.no_block_cache = true; + table_opts.cache_index_and_filter_blocks = false; // MBZ or error w/o block_cache + } + // Setup the cache for compressed assets. const auto &cache_size_comp(this->descriptor->cache_size_comp); if(cache_size_comp != 0)