提交 6c66bc08 编写于 作者: S sdong

Temp Fix of LogBuffer flushing

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
上级 cb980216
...@@ -1923,13 +1923,13 @@ void DBImpl::BackgroundCallFlush() { ...@@ -1923,13 +1923,13 @@ void DBImpl::BackgroundCallFlush() {
if (madeProgress) { if (madeProgress) {
MaybeScheduleFlushOrCompaction(); MaybeScheduleFlushOrCompaction();
} }
log_buffer.FlushBufferToLog();
bg_cv_.SignalAll(); bg_cv_.SignalAll();
// IMPORTANT: there should be no code after calling SignalAll. This call may // 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 // signal the DB destructor that it's OK to proceed with destruction. In
// that case, all DB variables will be dealloacated and referencing them // that case, all DB variables will be dealloacated and referencing them
// will cause trouble. // will cause trouble.
} }
log_buffer.FlushBufferToLog();
} }
...@@ -1996,13 +1996,13 @@ void DBImpl::BackgroundCallCompaction() { ...@@ -1996,13 +1996,13 @@ void DBImpl::BackgroundCallCompaction() {
if (madeProgress) { if (madeProgress) {
MaybeScheduleFlushOrCompaction(); MaybeScheduleFlushOrCompaction();
} }
log_buffer.FlushBufferToLog();
bg_cv_.SignalAll(); bg_cv_.SignalAll();
// IMPORTANT: there should be no code after calling SignalAll. This call may // 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 // signal the DB destructor that it's OK to proceed with destruction. In
// that case, all DB variables will be dealloacated and referencing them // that case, all DB variables will be dealloacated and referencing them
// will cause trouble. // will cause trouble.
} }
log_buffer.FlushBufferToLog();
} }
Status DBImpl::BackgroundCompaction(bool* madeProgress, Status DBImpl::BackgroundCompaction(bool* madeProgress,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册