diff --git a/db/compaction_picker.cc b/db/compaction_picker.cc index 2cf4db8a3..afc3f0993 100644 --- a/db/compaction_picker.cc +++ b/db/compaction_picker.cc @@ -1708,14 +1708,14 @@ Compaction* UniversalCompactionPicker::PickCompactionUniversalSizeAmp( LogToBuffer( log_buffer, "[%s] Universal: size amp not needed. newer-files-total-size %" PRIu64 - "earliest-file-size %" PRIu64, + " earliest-file-size %" PRIu64, cf_name.c_str(), candidate_size, earliest_file_size); return nullptr; } else { LogToBuffer( log_buffer, "[%s] Universal: size amp needed. newer-files-total-size %" PRIu64 - "earliest-file-size %" PRIu64, + " earliest-file-size %" PRIu64, cf_name.c_str(), candidate_size, earliest_file_size); } assert(start_index < sorted_runs.size() - 1); diff --git a/db/db_universal_compaction_test.cc b/db/db_universal_compaction_test.cc index ce73a69c3..7eab802d4 100644 --- a/db/db_universal_compaction_test.cc +++ b/db/db_universal_compaction_test.cc @@ -127,7 +127,7 @@ TEST_P(DBTestUniversalCompaction, UniversalCompactionSingleSortedRun) { options.level0_file_num_compaction_trigger = 0; options.compaction_options_universal.size_ratio = 10; options.compaction_options_universal.min_merge_width = 2; - options.compaction_options_universal.max_size_amplification_percent = 1; + options.compaction_options_universal.max_size_amplification_percent = 0; options.write_buffer_size = 105 << 10; // 105KB options.arena_block_size = 4 << 10; @@ -151,6 +151,9 @@ TEST_P(DBTestUniversalCompaction, UniversalCompactionSingleSortedRun) { dbfull()->TEST_WaitForCompact(); ASSERT_EQ(NumSortedRuns(0), 1); } + ASSERT_OK(Put(Key(key_idx), "")); + dbfull()->TEST_WaitForCompact(); + ASSERT_EQ(NumSortedRuns(0), 1); } TEST_P(DBTestUniversalCompaction, OptimizeFiltersForHits) {