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
main
sdong 9 years ago
parent cecd903ad9
commit 9aca7cd6d8
  1. 4
      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) {

Loading…
Cancel
Save