From 2fb1fea30fd027bbd824a26b682d04d91a8661dc Mon Sep 17 00:00:00 2001 From: Igor Canadi Date: Thu, 18 Sep 2014 10:42:54 -0700 Subject: [PATCH] Fix syncronization issues --- db/db_impl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/db_impl.cc b/db/db_impl.cc index addce91c2..26df8fb2a 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -1559,6 +1559,7 @@ Status DBImpl::WriteLevel0Table(ColumnFamilyData* cfd, // threads could be concurrently producing compacted files for // that key range. if (base != nullptr && db_options_.max_background_compactions <= 1 && + db_options_.max_background_flushes == 0 && cfd->ioptions()->compaction_style == kCompactionStyleLevel) { level = base->PickLevelForMemTableOutput(min_user_key, max_user_key); } @@ -1913,7 +1914,6 @@ Status DBImpl::RunManualCompaction(ColumnFamilyData* cfd, int input_level, bg_cv_.Wait(); } else { manual_compaction_ = &manual; - assert(bg_compaction_scheduled_ == 0); bg_compaction_scheduled_++; env_->Schedule(&DBImpl::BGWorkCompaction, this, Env::Priority::LOW); }