From eaea45656eb45d7a9c5316ecb009d2408d59b12d Mon Sep 17 00:00:00 2001 From: John Sully Date: Mon, 7 Mar 2022 16:41:51 -0500 Subject: [PATCH] Fix FLASH Read performance after data is loaded from fastsync (the rocksdb files have compression enabled when written by the bulkWrite function --- src/storage/rocksdbfactory.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/storage/rocksdbfactory.cpp b/src/storage/rocksdbfactory.cpp index c7f45b977..6a551c28b 100644 --- a/src/storage/rocksdbfactory.cpp +++ b/src/storage/rocksdbfactory.cpp @@ -21,6 +21,16 @@ rocksdb::Options DefaultRocksDBOptions() { options.allow_mmap_reads = true; options.avoid_unnecessary_blocking_io = true; options.prefix_extractor.reset(rocksdb::NewFixedPrefixTransform(0)); + + rocksdb::BlockBasedTableOptions table_options; + table_options.block_size = 16 * 1024; + table_options.cache_index_and_filter_blocks = true; + table_options.pin_l0_filter_and_index_blocks_in_cache = true; + table_options.data_block_index_type = rocksdb::BlockBasedTableOptions::kDataBlockBinaryAndHash; + table_options.checksum = rocksdb::kNoChecksum; + table_options.format_version = 4; + options.table_factory.reset(NewBlockBasedTableFactory(table_options)); + return options; } @@ -51,19 +61,9 @@ RocksDBStorageFactory::RocksDBStorageFactory(const char *dbfile, int dbnum, cons options.sst_file_manager = m_pfilemanager; options.create_if_missing = true; options.create_missing_column_families = true; + options.info_log_level = rocksdb::ERROR_LEVEL; rocksdb::DB *db = nullptr; - rocksdb::BlockBasedTableOptions table_options; - table_options.block_size = 16 * 1024; - table_options.cache_index_and_filter_blocks = true; - table_options.pin_l0_filter_and_index_blocks_in_cache = true; - table_options.data_block_index_type = rocksdb::BlockBasedTableOptions::kDataBlockBinaryAndHash; - table_options.checksum = rocksdb::kNoChecksum; - table_options.format_version = 4; - options.table_factory.reset(NewBlockBasedTableFactory(table_options)); - options.table_factory.reset( - rocksdb::NewBlockBasedTableFactory(table_options)); - for (int idb = 0; idb < dbnum; ++idb) { rocksdb::ColumnFamilyOptions cf_options(options);