Skip to content

Commit

Permalink
Don't not suggest flushing data when data block is still empty
Browse files Browse the repository at this point in the history
Summary:

This diff fix the bug when the Options::block_size is too small.
  • Loading branch information
liukai committed Nov 12, 2013
1 parent 94e139f commit 0ef6285
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions table/flush_block_policy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ class FlushBlockBySizePolicy : public FlushBlockPolicy {

virtual bool Update(const Slice& key,
const Slice& value) override {
// it makes no sense to flush when the data block is empty
if (data_block_builder_.empty()) {
return false;
}

auto curr_size = data_block_builder_.CurrentSizeEstimate();

// Do flush if one of the below two conditions is true:
Expand Down

0 comments on commit 0ef6285

Please sign in to comment.