Move a info logging out of DB Mutex

Summary: As we know, logging can be slow, or even hang for some file systems. Move one more logging out of DB mutex.

Test Plan: make all check

Reviewers: haobo, igor, ljin

Reviewed By: igor

CC: yhchiang, nkg-, leveldb

Differential Revision: https://reviews.facebook.net/D17427
This commit is contained in:
sdong 2014-04-02 16:34:19 -07:00
parent c9622aab77
commit 158845ba9a

View File

@ -4034,6 +4034,9 @@ Status DBImpl::MakeRoomForWrite(bool force,
new_mem = new MemTable(internal_comparator_, options_);
new_superversion = new SuperVersion();
}
Log(options_.info_log,
"New memtable created with log file: #%lu\n",
(unsigned long)new_log_number);
}
mutex_.Lock();
if (!s.ok()) {
@ -4051,9 +4054,6 @@ Status DBImpl::MakeRoomForWrite(bool force,
}
mem_ = new_mem;
mem_->Ref();
Log(options_.info_log,
"New memtable created with log file: #%lu\n",
(unsigned long)logfile_number_);
mem_->SetLogNumber(logfile_number_);
force = false; // Do not force another compaction if have room
MaybeScheduleFlushOrCompaction();