Fixed a segfault when compaction fails

Summary: We've hit it today.

Test Plan: `make -j check`; didn't reproduce the issue

Reviewers: yhchiang

Reviewed By: yhchiang

Subscribers: dhruba

Differential Revision: https://reviews.facebook.net/D54219
main
Mike Kolupaev 9 years ago
parent 2f084d39b9
commit 44371501f0
  1. 3
      db/db_impl.cc

@ -1849,7 +1849,6 @@ Status DBImpl::CompactFilesImpl(
c->column_family_data(), job_context, *c->mutable_cf_options());
}
c->ReleaseCompactionFiles(s);
c.reset();
if (status.ok()) {
// Done
@ -1865,6 +1864,8 @@ Status DBImpl::CompactFilesImpl(
}
}
c.reset();
bg_compaction_scheduled_--;
if (bg_compaction_scheduled_ == 0) {
bg_cv_.SignalAll();

Loading…
Cancel
Save