diff --git a/HISTORY.md b/HISTORY.md index 9b05f8a49f7f309efd70e8950c1b0c49955d5661..cf566b49dc567476c42e3f274fc1d1d56a152094 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -6,6 +6,7 @@ ### New Features * Avoid unnecessarily flushing in `CompactRange()` when the range specified by the user does not overlap unflushed memtables. +* If `ColumnFamilyOptions::max_subcompactions` is set greater than one, we now parallelize large manual level-based compactions. * Add "rocksdb.live-sst-files-size" DB property to return total bytes of all SST files belong to the latest LSM tree. ### Bug Fixes diff --git a/db/compaction.cc b/db/compaction.cc index c2785adeeb6f7000327d676c18da014f840b4119..9db41139b51ac36a3168289c04657b9fec756ad9 100644 --- a/db/compaction.cc +++ b/db/compaction.cc @@ -446,7 +446,8 @@ bool Compaction::ShouldFormSubcompactions() const { return false; } if (cfd_->ioptions()->compaction_style == kCompactionStyleLevel) { - return start_level_ == 0 && output_level_ > 0 && !IsOutputLevelEmpty(); + return (start_level_ == 0 || is_manual_compaction_) && output_level_ > 0 && + !IsOutputLevelEmpty(); } else if (cfd_->ioptions()->compaction_style == kCompactionStyleUniversal) { return number_levels_ > 1 && output_level_ > 0; } else {