From 7784980fcd92282842befd241c2650bd59bdb872 Mon Sep 17 00:00:00 2001 From: Siying Dong Date: Tue, 29 Nov 2016 10:49:47 -0800 Subject: [PATCH] Fix mis-reporting of compaction read bytes to the base level Summary: In dynamic leveled compaction, when calculating read bytes, output level bytes may be wronglyl calculated as input level inputs. Fix it. Closes https://github.com/facebook/rocksdb/pull/1475 Differential Revision: D4148412 Pulled By: siying fbshipit-source-id: f2f475a --- db/compaction_job.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/db/compaction_job.cc b/db/compaction_job.cc index 503c1c212..8604f21f9 100644 --- a/db/compaction_job.cc +++ b/db/compaction_job.cc @@ -1261,8 +1261,7 @@ void CompactionJob::UpdateCompactionStats() { for (int input_level = 0; input_level < static_cast(compaction->num_input_levels()); ++input_level) { - if (compaction->start_level() + input_level - != compaction->output_level()) { + if (compaction->level(input_level) != compaction->output_level()) { UpdateCompactionInputStatsHelper( &compaction_stats_.num_input_files_in_non_output_levels, &compaction_stats_.bytes_read_non_output_levels,