From: sdong Date: Fri, 17 Sep 2021 21:43:53 +0000 (-0700) Subject: Fix ldb --try_load_options doesn't use customized Env (#8929) X-Git-Tag: v6.25.1~12 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ba48ff8303aad3bcfdae070191dfe587d2720d44;p=rocksdb.git Fix ldb --try_load_options doesn't use customized Env (#8929) Summary: As title. The reason is that after loading customized options, the env is not set back to the correct one. Fix it. Pull Request resolved: https://github.com/facebook/rocksdb/pull/8929 Test Plan: Manually validate in an environment where the command failed. Reviewed By: riversand963 Differential Revision: D31026931 fbshipit-source-id: c25dc788bf80ed5bf4b24922c442781943bcd65b --- diff --git a/tools/ldb_cmd.cc b/tools/ldb_cmd.cc index b3d443c46..891149fc6 100644 --- a/tools/ldb_cmd.cc +++ b/tools/ldb_cmd.cc @@ -722,6 +722,10 @@ void LDBCommand::PrepareOptions() { } } + if (options_.env == Env::Default()) { + options_.env = config_options_.env; + } + OverrideBaseOptions(); if (exec_state_.IsFailed()) { return;