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
This commit is contained in:
Mike Kolupaev 2016-02-16 11:11:16 -08:00
parent 2f084d39b9
commit 44371501f0

View file

@ -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();