Skip to content

Commit

Permalink
Print DB pointer when opening a DB
Browse files Browse the repository at this point in the history
Summary: Having a pointer for DB will be helpful to debug when GDB or working on a dump. If the client process doesn't have any thread actively working on RocksDB, it can be hard to find out.

Test Plan: make all check

Reviewers: rven, yhchiang, igor

Reviewed By: igor

Subscribers: yoshinorim, dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D33159
  • Loading branch information
siying committed Feb 9, 2015
1 parent bee4e51 commit 91ac3b2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions db/db_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3853,6 +3853,8 @@ Status DB::Open(const DBOptions& db_options, const std::string& dbname,

if (s.ok()) {
impl->opened_successfully_ = true;
Log(InfoLogLevel::INFO_LEVEL, impl->db_options_.info_log, "DB pointer %p",
impl);
*dbptr = impl;
} else {
for (auto* h : *handles) {
Expand Down

0 comments on commit 91ac3b2

Please sign in to comment.