diff --git a/db/compaction_job.cc b/db/compaction_job.cc index 22f376f90..d99ab5457 100644 --- a/db/compaction_job.cc +++ b/db/compaction_job.cc @@ -854,8 +854,9 @@ void CompactionJob::ProcessKeyValueCompaction(SubcompactionState* sub_compact) { // during subcompactions (i.e. if output size, estimated by input size, is // going to be 1.2MB and max_output_file_size = 1MB, prefer to have 0.6MB // and 0.6MB instead of 1MB and 0.2MB) - if (sub_compact->current_output_file_size >= - sub_compact->compaction->max_output_file_size()) { + if (sub_compact->compaction->output_level() != 0 && + sub_compact->current_output_file_size >= + sub_compact->compaction->max_output_file_size()) { const Slice* next_key = nullptr; if (c_iter->Valid()) { next_key = &c_iter->key();