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
This commit is contained in:
Siying Dong 2016-11-29 10:49:47 -08:00 committed by Facebook Github Bot
parent 3c6b49ed66
commit 7784980fcd

View File

@ -1261,8 +1261,7 @@ void CompactionJob::UpdateCompactionStats() {
for (int input_level = 0;
input_level < static_cast<int>(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,