diff --git a/db/db_impl.cc b/db/db_impl.cc index ca91b5e82a..49fd3c9fb7 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -1923,13 +1923,13 @@ void DBImpl::BackgroundCallFlush() { if (madeProgress) { MaybeScheduleFlushOrCompaction(); } + log_buffer.FlushBufferToLog(); bg_cv_.SignalAll(); // IMPORTANT: there should be no code after calling SignalAll. This call may // signal the DB destructor that it's OK to proceed with destruction. In // that case, all DB variables will be dealloacated and referencing them // will cause trouble. } - log_buffer.FlushBufferToLog(); } @@ -1996,13 +1996,13 @@ void DBImpl::BackgroundCallCompaction() { if (madeProgress) { MaybeScheduleFlushOrCompaction(); } + log_buffer.FlushBufferToLog(); bg_cv_.SignalAll(); // IMPORTANT: there should be no code after calling SignalAll. This call may // signal the DB destructor that it's OK to proceed with destruction. In // that case, all DB variables will be dealloacated and referencing them // will cause trouble. } - log_buffer.FlushBufferToLog(); } Status DBImpl::BackgroundCompaction(bool* madeProgress,