Skip to content

Commit 534d051

Browse files
branch-3.0: [enhacement](cloud) Make config::custom_conf_path default to use conf_path's value specified when started #50381 (#50474)
Cherry-picked from #50381 Co-authored-by: Siyang Tang <tangsiyang@selectdb.com>
1 parent a6a9f99 commit 534d051

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

cloud/src/common/config.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,16 @@ CONF_Int32(log_verbose_level, "5");
5454
// Only works when starting Cloud with --console.
5555
CONF_Bool(enable_file_logger, "true");
5656

57-
// Custom conf path is default the same as conf path, and configs will be append to it.
58-
// Otherwise, will a new custom conf file will be created.
59-
CONF_String(custom_conf_path, "./conf/doris_cloud.conf");
57+
// Custom conf path is default empty.
58+
// All mutable configs' modification needed to be persisted will be appended to conf path
59+
// specified when started.
60+
//
61+
// If it is set to equivalent value of conf path specified when started,
62+
// mutable configs' modification behavior will be the same as the description above.
63+
//
64+
// Otherwise, a new custom conf file will be created when mutable configs are modified
65+
// and persisted, with all modification written to it.
66+
CONF_String(custom_conf_path, "");
6067

6168
// recycler config
6269
CONF_mInt64(recycle_interval_seconds, "3600");

cloud/src/main.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@ int main(int argc, char** argv) {
202202
std::cerr << "failed to init config file, conf=" << conf_file << std::endl;
203203
return -1;
204204
}
205+
if (config::custom_conf_path.empty()) {
206+
config::custom_conf_path = conf_file;
207+
}
205208
if (!std::filesystem::equivalent(conf_file, config::custom_conf_path) &&
206209
!config::init(config::custom_conf_path.c_str(), false)) {
207210
std::cerr << "failed to init custom config file, conf=" << config::custom_conf_path

0 commit comments

Comments
 (0)