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
This commit is contained in:
sdong 2022-03-31 15:52:01 -07:00 committed by Andrew Kryczka
parent e07d836391
commit 8654ac5d9a

View File

@ -1971,10 +1971,10 @@ Status DBImpl::Open(const DBOptions& db_options, const std::string& dbname,
"DB::Open() failed --- Unable to persist Options file", "DB::Open() failed --- Unable to persist Options file",
persist_options_status.ToString()); persist_options_status.ToString());
} }
} else { }
if (!s.ok()) {
ROCKS_LOG_WARN(impl->immutable_db_options_.info_log, ROCKS_LOG_WARN(impl->immutable_db_options_.info_log,
"Persisting Option File error: %s", "DB::Open() failed: %s", s.ToString().c_str());
persist_options_status.ToString().c_str());
} }
if (s.ok()) { if (s.ok()) {
s = impl->StartPeriodicWorkScheduler(); s = impl->StartPeriodicWorkScheduler();