From 9aca7cd6d8e182c0a67204dc0756c75b2ae996ce Mon Sep 17 00:00:00 2001 From: sdong Date: Wed, 16 Sep 2015 16:04:31 -0700 Subject: [PATCH] DB::Open() to flush info log after printing DB pointer Summary: Now DB::Open() flushes info log before printing DB pointer, so it may not show up if no activity after DB open. Move log flushing from after printing options to printing DB pointer. Test Plan: make commit-prereq Reviewers: igor, IslamAbdelRahman, yhchiang, kradhakrishnan, anthony, rven Reviewed By: rven Subscribers: leveldb, dhruba Differential Revision: https://reviews.facebook.net/D47121 --- db/db_impl.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/db_impl.cc b/db/db_impl.cc index f15901d8c..4918284bc 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -281,8 +281,6 @@ DBImpl::DBImpl(const DBOptions& options, const std::string& dbname) DumpDBFileSummary(db_options_, dbname_); db_options_.Dump(db_options_.info_log.get()); DumpSupportInfo(db_options_.info_log.get()); - - LogFlush(db_options_.info_log); } // Will lock the mutex_, will wait for completion if wait is true @@ -4495,6 +4493,8 @@ Status DB::Open(const DBOptions& db_options, const std::string& dbname, if (s.ok()) { Log(InfoLogLevel::INFO_LEVEL, impl->db_options_.info_log, "DB pointer %p", impl); + LogFlush(impl->db_options_.info_log); + *dbptr = impl; } else { for (auto* h : *handles) {