From 44371501f00588530d876d938a46c8c276975912 Mon Sep 17 00:00:00 2001 From: Mike Kolupaev Date: Tue, 16 Feb 2016 11:11:16 -0800 Subject: [PATCH] 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 --- db/db_impl.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db/db_impl.cc b/db/db_impl.cc index 3745eaab1..cf8b17bb0 100644 --- a/db/db_impl.cc +++ b/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();