From bbcf7b192c12f4ad99e57f5727dd8e1429e206b3 Mon Sep 17 00:00:00 2001 From: sdong Date: Thu, 31 Mar 2022 15:52:01 -0700 Subject: [PATCH] Fix DB::Open() error logging (#9784) Summary: Right now we log a wrong error when DB::Open() fails. Fix it. Pull Request resolved: https://github.com/facebook/rocksdb/pull/9784 Test Plan: CI runs should pass Reviewed By: ajkr, riversand963 Differential Revision: D35290203 fbshipit-source-id: ffc640afa27f6b0a2382ee153dc43f28d9e242be --- db/db_impl/db_impl_open.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/db/db_impl/db_impl_open.cc b/db/db_impl/db_impl_open.cc index 419c2e9af..9a402b6dc 100644 --- a/db/db_impl/db_impl_open.cc +++ b/db/db_impl/db_impl_open.cc @@ -1971,10 +1971,10 @@ Status DBImpl::Open(const DBOptions& db_options, const std::string& dbname, "DB::Open() failed --- Unable to persist Options file", persist_options_status.ToString()); } - } else { + } + if (!s.ok()) { ROCKS_LOG_WARN(impl->immutable_db_options_.info_log, - "Persisting Option File error: %s", - persist_options_status.ToString().c_str()); + "DB::Open() failed: %s", s.ToString().c_str()); } if (s.ok()) { s = impl->StartPeriodicWorkScheduler();