diff --git a/db/compaction_picker_universal.cc b/db/compaction_picker_universal.cc index 9975ef80c..960c65d2b 100644 --- a/db/compaction_picker_universal.cc +++ b/db/compaction_picker_universal.cc @@ -603,9 +603,9 @@ Compaction* UniversalCompactionPicker::PickCompactionToReduceSortedRuns( CompactionReason compaction_reason; if (max_number_of_files_to_compact == UINT_MAX) { - compaction_reason = CompactionReason::kUniversalSortedRunNum; - } else { compaction_reason = CompactionReason::kUniversalSizeRatio; + } else { + compaction_reason = CompactionReason::kUniversalSortedRunNum; } return new Compaction( vstorage, ioptions_, mutable_cf_options, std::move(inputs), output_level, diff --git a/db/listener_test.cc b/db/listener_test.cc index 5b5f2266b..86646fdde 100644 --- a/db/listener_test.cc +++ b/db/listener_test.cc @@ -528,7 +528,7 @@ TEST_F(EventListenerTest, CompactionReasonUniversal) { ASSERT_GT(listener->compaction_reasons_.size(), 0); for (auto compaction_reason : listener->compaction_reasons_) { - ASSERT_EQ(compaction_reason, CompactionReason::kUniversalSortedRunNum); + ASSERT_EQ(compaction_reason, CompactionReason::kUniversalSizeRatio); } options.level0_file_num_compaction_trigger = 8;