Fixed a possible bug in DoCompactionWork

Summary:
There are two statuses in DoCompactionWork could be hidden.
This path fix this bug.

This seems to be a bug since CompactionFilterV2 is introduced:
https://github.com/facebook/rocksdb/blame/3.6.fb/db/db_impl.cc#L3294

Test Plan: make

Reviewers: nkg-, igor, sdong

Reviewed By: igor, sdong

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D28989
This commit is contained in:
Yueh-Hsuan Chiang 2014-12-22 10:10:31 -08:00
parent b11a617acd
commit edd6100e2b

View File

@ -3305,6 +3305,9 @@ Status DBImpl::DoCompactionWork(CompactionState* compact,
true,
&num_output_records,
log_buffer);
if (!status.ok()) {
break;
}
compact->CleanupBatchBuffer();
compact->CleanupMergedBuffer();
@ -3315,20 +3318,22 @@ Status DBImpl::DoCompactionWork(CompactionState* compact,
CallCompactionFilterV2(compact, compaction_filter_v2);
}
compact->MergeKeyValueSliceBuffer(&cfd->internal_comparator());
status = ProcessKeyValueCompaction(
mutable_cf_options,
is_snapshot_supported,
visible_at_tip,
earliest_snapshot,
latest_snapshot,
deletion_state,
bottommost_level,
imm_micros,
input.get(),
compact,
true,
&num_output_records,
log_buffer);
if (status.ok()) {
status = ProcessKeyValueCompaction(
mutable_cf_options,
is_snapshot_supported,
visible_at_tip,
earliest_snapshot,
latest_snapshot,
deletion_state,
bottommost_level,
imm_micros,
input.get(),
compact,
true,
&num_output_records,
log_buffer);
}
} // checking for compaction filter v2
if (status.ok() && (shutting_down_.Acquire_Load() || cfd->IsDropped())) {