Skip to content

Commit

Permalink
[fix](config) for compatibility issue of log dir config (#34734)
Browse files Browse the repository at this point in the history
* [fix](config) for compatibility issue of log dir config

* 1
  • Loading branch information
morningman authored May 12, 2024
1 parent 5cc7dd5 commit c6b469a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
11 changes: 9 additions & 2 deletions be/src/common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1732,11 +1732,18 @@ std::vector<std::vector<std::string>> get_config_info() {
std::vector<std::string> _config;
_config.push_back(it.first);

std::string config_val = it.second;
// For compatibility, this PR #32933 change the log dir's config logic,
// and deprecate the `sys_log_dir` config.
if (it.first == "sys_log_dir" && config_val == "") {
config_val = fmt::format("{}/log", std::getenv("DORIS_HOME"));
}

_config.emplace_back(field_it->second.type);
if (0 == strcmp(field_it->second.type, "bool")) {
_config.emplace_back(it.second == "1" ? "true" : "false");
_config.emplace_back(config_val == "1" ? "true" : "false");
} else {
_config.push_back(it.second);
_config.push_back(config_val);
}
_config.emplace_back(field_it->second.valmutable ? "true" : "false");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,13 @@ public static synchronized List<List<String>> getConfigInfo(PatternMatcher match
if (matcher == null || matcher.match(confKey)) {
List<String> config = Lists.newArrayList();
config.add(confKey);
config.add(getConfValue(f));
String value = getConfValue(f);
// For compatibility, this PR #32933 change the log dir's config logic,
// and deprecate the `sys_log_dir` config.
if (confKey.equals("sys_log_dir") && Strings.isNullOrEmpty(value)) {
value = System.getenv("DORIS_HOME") + "/log";
}
config.add(value);
config.add(f.getType().getSimpleName());
config.add(String.valueOf(confField.mutable()));
config.add(String.valueOf(confField.masterOnly()));
Expand Down

0 comments on commit c6b469a

Please sign in to comment.