mirror of
https://github.com/facebook/rocksdb.git
synced 2024-11-26 16:30:56 +00:00
Don't not suggest flushing data when data block is still empty
Summary: This diff fix the bug when the Options::block_size is too small.
This commit is contained in:
parent
94e139f94d
commit
0ef628537c
|
@ -28,6 +28,11 @@ class FlushBlockBySizePolicy : public FlushBlockPolicy {
|
||||||
|
|
||||||
virtual bool Update(const Slice& key,
|
virtual bool Update(const Slice& key,
|
||||||
const Slice& value) override {
|
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();
|
auto curr_size = data_block_builder_.CurrentSizeEstimate();
|
||||||
|
|
||||||
// Do flush if one of the below two conditions is true:
|
// Do flush if one of the below two conditions is true:
|
||||||
|
|
Loading…
Reference in a new issue