diff --git a/db/db_block_cache_test.cc b/db/db_block_cache_test.cc index a4ceb908fd..7a6a58135a 100644 --- a/db/db_block_cache_test.cc +++ b/db/db_block_cache_test.cc @@ -1834,6 +1834,7 @@ class DBBlockCachePinningTest PinningTier unpartitioned_pinning_; }; +#ifdef LZ4 TEST_P(DBBlockCachePinningTest, TwoLevelDB) { // Creates one file in L0 and one file in L1. Both files have enough data that // their index and filter blocks are partitioned. The L1 file will also have @@ -1845,10 +1846,7 @@ TEST_P(DBBlockCachePinningTest, TwoLevelDB) { const int kNumKeysPerFile = kBlockSize * kNumBlocksPerFile / kKeySize; Options options = CurrentOptions(); - // `kNoCompression` makes the unit test more portable. But it relies on the - // current behavior of persisting/accessing dictionary even when there's no - // (de)compression happening, which seems fairly likely to change over time. - options.compression = kNoCompression; + options.compression = kLZ4Compression; options.compression_opts.max_dict_bytes = 4 << 10; options.statistics = ROCKSDB_NAMESPACE::CreateDBStatistics(); BlockBasedTableOptions table_options; @@ -1961,6 +1959,7 @@ TEST_P(DBBlockCachePinningTest, TwoLevelDB) { ASSERT_EQ(expected_compression_dict_misses, TestGetTickerCount(options, BLOCK_CACHE_COMPRESSION_DICT_MISS)); } +#endif INSTANTIATE_TEST_CASE_P( DBBlockCachePinningTest, DBBlockCachePinningTest, diff --git a/table/block_based/block_based_table_builder.cc b/table/block_based/block_based_table_builder.cc index 3f80c2d4fc..eb2ae4ddba 100644 --- a/table/block_based/block_based_table_builder.cc +++ b/table/block_based/block_based_table_builder.cc @@ -480,8 +480,10 @@ struct BlockBasedTableBuilder::Rep { compression_ctxs(tbo.compression_opts.parallel_threads), verify_ctxs(tbo.compression_opts.parallel_threads), verify_dict(), - state((tbo.compression_opts.max_dict_bytes > 0) ? State::kBuffered - : State::kUnbuffered), + state((tbo.compression_opts.max_dict_bytes > 0 && + tbo.compression_type != kNoCompression) + ? State::kBuffered + : State::kUnbuffered), use_delta_encoding_for_index_values(table_opt.format_version >= 4 && !table_opt.block_align), reason(tbo.reason),