diff --git a/db/db_impl/db_impl_compaction_flush.cc b/db/db_impl/db_impl_compaction_flush.cc index 0fa85bb2dd..c326dfd43b 100644 --- a/db/db_impl/db_impl_compaction_flush.cc +++ b/db/db_impl/db_impl_compaction_flush.cc @@ -3986,7 +3986,10 @@ Status DBImpl::BackgroundCompaction(bool* made_progress, // Sanity checking that compaction files are freed. for (size_t i = 0; i < c->num_input_levels(); i++) { for (size_t j = 0; j < c->inputs(i)->size(); j++) { - assert(!c->input(i, j)->being_compacted); + // When status is not OK, compaction's result installation failed and + // no new Version installed. The files could have been released and + // picked up again by other compaction attempts. + assert(!c->input(i, j)->being_compacted || !status.ok()); } } std::unordered_set* cip = c->column_family_data()