Skip to content

Commit

Permalink
CompactedDB: log using the correct info_log
Browse files Browse the repository at this point in the history
Summary:
info_log from supplied Options can be nullptr. Using the one from
db_impl. Also call flush after that since no more loggging will happen
and LOG can contain partial output

Test Plan: verified with db_bench

Reviewers: igor, yhchiang, sdong

Reviewed By: sdong

Subscribers: leveldb

Differential Revision: https://reviews.facebook.net/D24183
  • Loading branch information
Lei Jin committed Sep 29, 2014
1 parent 2faf49d commit fd5d80d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion db/db_impl_readonly.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ namespace rocksdb {
DBImplReadOnly::DBImplReadOnly(const DBOptions& db_options,
const std::string& dbname)
: DBImpl(db_options, dbname) {
Log(db_options_.info_log, "Opening the db in read only mode");
Log(INFO_LEVEL, db_options_.info_log, "Opening the db in read only mode");
LogFlush(db_options_.info_log);
}

DBImplReadOnly::~DBImplReadOnly() {
Expand Down
4 changes: 3 additions & 1 deletion utilities/compacted_db/compacted_db_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,10 @@ Status CompactedDBImpl::Open(const Options& options,
std::unique_ptr<CompactedDBImpl> db(new CompactedDBImpl(db_options, dbname));
Status s = db->Init(options);
if (s.ok()) {
Log(INFO_LEVEL, db->db_options_.info_log,
"Opened the db as fully compacted mode");
LogFlush(db->db_options_.info_log);
*dbptr = db.release();
Log(options.info_log, "Opened the db as fully compacted mode");
}
return s;
}
Expand Down

0 comments on commit fd5d80d

Please sign in to comment.