From 7f04af32a5cff78a9aa773c010b344616a4c0b5a Mon Sep 17 00:00:00 2001 From: Yi Wu Date: Wed, 6 Dec 2017 16:38:49 -0800 Subject: [PATCH] ldb to allow db with --try_load_options and without an options file Summary: This is to fix tools/check_format_compatible.sh. The tool try to open old versions of rocksdb with the provided options file. When options file is missing (e.g. rocksdb 2.2), it should still proceed with default options. Closes https://github.com/facebook/rocksdb/pull/3232 Differential Revision: D6503955 Pulled By: yiwu-arbug fbshipit-source-id: e44cfcce7ddc7d12cf83466ed3f3fe7624aa78b8 --- tools/ldb_cmd.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ldb_cmd.cc b/tools/ldb_cmd.cc index 61b6b17f7..5c9f363a7 100644 --- a/tools/ldb_cmd.cc +++ b/tools/ldb_cmd.cc @@ -315,7 +315,7 @@ void LDBCommand::OpenDB() { if (!create_if_missing_ && try_load_options_) { Status s = LoadLatestOptions(db_path_, Env::Default(), &options_, &column_families_, ignore_unknown_options_); - if (!s.ok()) { + if (!s.ok() && !s.IsNotFound()) { // Option file exists but load option file error. std::string msg = s.ToString(); exec_state_ = LDBCommandExecuteResult::Failed(msg);