diff --git a/HISTORY.md b/HISTORY.md index cbc0615ca..124f54c34 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -22,6 +22,7 @@ * Deleting Blob files also go through SStFileManager. * Remove PlainTable's store_index_in_file feature. When opening an existing DB with index in SST files, the index and bloom filter will still be rebuild while SST files are opened, in the same way as there is no index in the file. * Remove CuckooHash memtable. +* The counter stat `number.block.not_compressed` now also counts blocks not compressed due to poor compression ratio. ### Bug Fixes * Fix a deadlock caused by compaction and file ingestion waiting for each other in the event of write stalls. diff --git a/table/block_based_table_builder.cc b/table/block_based_table_builder.cc index acc0c85f5..75aaeaeb7 100644 --- a/table/block_based_table_builder.cc +++ b/table/block_based_table_builder.cc @@ -581,6 +581,8 @@ void BlockBasedTableBuilder::WriteBlock(const Slice& raw_block_contents, MeasureTime(r->ioptions.statistics, BYTES_COMPRESSED, raw_block_contents.size()); RecordTick(r->ioptions.statistics, NUMBER_BLOCK_COMPRESSED); + } else if (type != r->compression_type) { + RecordTick(r->ioptions.statistics, NUMBER_BLOCK_NOT_COMPRESSED); } WriteRawBlock(block_contents, type, handle, is_data_block);