From 79496d71ed9789b33340ba786b83d4a2e8033b00 Mon Sep 17 00:00:00 2001 From: "Peter (Stig) Edwards" Date: Mon, 11 Feb 2019 17:46:49 -0800 Subject: [PATCH] Increment NUMBER_BLOCK_NOT_COMPRESSED when !GoodCompressionRatio (#4929) Summary: See https://github.com/facebook/rocksdb/issues/4884 Pull Request resolved: https://github.com/facebook/rocksdb/pull/4929 Differential Revision: D14028333 Pulled By: sagar0 fbshipit-source-id: eed12bceae85385a34aaa6dd303bf0f53c4c7b06 --- HISTORY.md | 1 + table/block_based_table_builder.cc | 2 ++ 2 files changed, 3 insertions(+) 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);