From 468c7e6f071a8ae21ba2efac73b8ff27500bcfea Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 16 Oct 2018 13:25:45 -0700 Subject: [PATCH] ircd::db: Add metadata block size parameter to the descriptor. --- include/ircd/db/descriptor.h | 8 ++++++++ ircd/db.cc | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/ircd/db/descriptor.h b/include/ircd/db/descriptor.h index 4e5e80570..e6b301b0e 100644 --- a/include/ircd/db/descriptor.h +++ b/include/ircd/db/descriptor.h @@ -67,6 +67,14 @@ struct ircd::db::descriptor /// than this size. size_t block_size { 512 }; + /// Data block size for metadata blocks. Other configuration which may + /// not yet be in this descriptor affects the best choice of this param; + /// generally these blocks are preloaded on DB open. They can also + /// participate in the block cache. At the time this comment was written + /// top-level metadata blocks are preloaded and leaf blocks are put in + /// the cache. + size_t meta_block_size { 512 }; + /// User given compaction callback surface. db::compactor compactor {}; }; diff --git a/ircd/db.cc b/ircd/db.cc index 8a5a74fd8..a99d4fe2c 100644 --- a/ircd/db.cc +++ b/ircd/db.cc @@ -1444,8 +1444,8 @@ ircd::db::database::column::column(database *const &d, table_opts.pin_l0_filter_and_index_blocks_in_cache = false; // Setup the block size - table_opts.metadata_block_size = 512; table_opts.block_size = this->descriptor.block_size; + table_opts.metadata_block_size = this->descriptor.meta_block_size; // Setup the cache for assets. const auto &cache_size(this->descriptor.cache_size);