diff --git a/HISTORY.md b/HISTORY.md index 5127ff7aa..5435a1a98 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,4 +1,8 @@ # Rocksdb Change Log +## Unreleased +### Bug Fixes +* Avoid creating empty SSTs and subsequently deleting them in certain cases during compaction. + ## 5.15.6 (8/21/2018) ### Public API Change * The merge operands are passed to `MergeOperator::ShouldMerge` in the reversed order relative to how they were merged (passed to FullMerge or FullMergeV2) for performance reasons diff --git a/db/compaction_job.cc b/db/compaction_job.cc index 94c6762a2..aecbecb25 100644 --- a/db/compaction_job.cc +++ b/db/compaction_job.cc @@ -1075,7 +1075,8 @@ void CompactionJob::ProcessKeyValueCompaction(SubcompactionState* sub_compact) { } if (status.ok() && sub_compact->builder == nullptr && - sub_compact->outputs.size() == 0) { + sub_compact->outputs.size() == 0 && + !range_del_agg->IsEmpty()) { // handle subcompaction containing only range deletions status = OpenCompactionOutputFile(sub_compact); }