From 158845ba9af59228ea08051848426deb532380b6 Mon Sep 17 00:00:00 2001 From: sdong Date: Wed, 2 Apr 2014 16:34:19 -0700 Subject: [PATCH] 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 --- db/db_impl.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/db/db_impl.cc b/db/db_impl.cc index c6481ce9c..bb1f839a9 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -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();