Skip to content

Commit

Permalink
Flush Buffered Info Logs Before Doing Compaction (one line change)
Browse files Browse the repository at this point in the history
Summary: Flushing log buffer earlier to avoid confusion of time holding the locks.

Test Plan: Should be safe as long as several related db test passes

Reviewers: haobo, igor, ljin

Reviewed By: igor

CC: nkg-, leveldb

Differential Revision: https://reviews.facebook.net/D17493
  • Loading branch information
siying committed Apr 4, 2014
1 parent ef7dc38 commit 99c756f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions db/db_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2945,6 +2945,7 @@ Status DBImpl::DoCompactionWork(CompactionState* compact,

// Release mutex while we're actually doing the compaction work
mutex_.Unlock();
log_buffer->FlushBufferToLog();

const uint64_t start_micros = env_->NowMicros();
unique_ptr<Iterator> input(versions_->MakeInputIterator(compact->compaction));
Expand Down

0 comments on commit 99c756f

Please sign in to comment.