]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
Flush Buffered Info Logs Before Doing Compaction (one line change)
authorsdong <siying.d@fb.com>
Fri, 4 Apr 2014 17:28:58 +0000 (10:28 -0700)
committersdong <siying.d@fb.com>
Fri, 4 Apr 2014 17:58:30 +0000 (10:58 -0700)
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

db/db_impl.cc

index 0f1d227cd3d1942c1941de12ba839bdaf59e8031..28cf48547af9a07c04a74796c416b5e1f35119d4 100644 (file)
@@ -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));