Skip to content

Commit

Permalink
Temp Fix of LogBuffer flushing
Browse files Browse the repository at this point in the history
Summary: To temp fix the log buffer flushing. Flush the buffer inside the lock. Clean the trunk before we find an eventual fix.

Test Plan: make all check

Reviewers: haobo, igor

Reviewed By: igor

CC: ljin, leveldb, yhchiang

Differential Revision: https://reviews.facebook.net/D16791
  • Loading branch information
siying committed Mar 11, 2014
1 parent cb98021 commit 6c66bc0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions db/db_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}


Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 6c66bc0

Please sign in to comment.