Handle full final subcompaction output file with range deletions

Summary:
This conditional should only open a new file that's dedicated to range deletions when it's the sole output of the subcompaction. Previously, we created such a file whenever the table builder was nullptr, which would've also been the case whenever the CompactionIterator's final key coincided with the final output table becoming full.
Closes https://github.com/facebook/rocksdb/pull/1507

Differential Revision: D4174613

Pulled By: ajkr

fbshipit-source-id: 9ffacea
main
Andrew Kryczka 8 years ago committed by Facebook Github Bot
parent 6c57952002
commit 3b192f6186
  1. 2
      db/compaction_job.cc

@ -896,7 +896,9 @@ void CompactionJob::ProcessKeyValueCompaction(SubcompactionState* sub_compact) {
"Database shutdown or Column family drop during compaction"); "Database shutdown or Column family drop during compaction");
} }
if (status.ok() && sub_compact->builder == nullptr && if (status.ok() && sub_compact->builder == nullptr &&
sub_compact->outputs.size() == 0 &&
range_del_agg->ShouldAddTombstones(bottommost_level_)) { range_del_agg->ShouldAddTombstones(bottommost_level_)) {
// handle subcompaction containing only range deletions
status = OpenCompactionOutputFile(sub_compact); status = OpenCompactionOutputFile(sub_compact);
} }
if (status.ok() && sub_compact->builder != nullptr) { if (status.ok() && sub_compact->builder != nullptr) {

Loading…
Cancel
Save