This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new c6b469aad65 [fix](config) for compatibility issue of log dir config
(#34734)
c6b469aad65 is described below
commit c6b469aad657a50a6b8d0f11179dcc202485e619
Author: Mingyu Chen <[email protected]>
AuthorDate: Sun May 12 09:44:15 2024 +0800
[fix](config) for compatibility issue of log dir config (#34734)
* [fix](config) for compatibility issue of log dir config
* 1
---
be/src/common/config.cpp | 11 +++++++++--
.../src/main/java/org/apache/doris/common/ConfigBase.java | 8 +++++++-
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp
index a773e1a8bfe..8055e3fe456 100644
--- a/be/src/common/config.cpp
+++ b/be/src/common/config.cpp
@@ -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");
diff --git a/fe/fe-common/src/main/java/org/apache/doris/common/ConfigBase.java
b/fe/fe-common/src/main/java/org/apache/doris/common/ConfigBase.java
index dd66fdcb0f5..3306f314f7d 100644
--- a/fe/fe-common/src/main/java/org/apache/doris/common/ConfigBase.java
+++ b/fe/fe-common/src/main/java/org/apache/doris/common/ConfigBase.java
@@ -376,7 +376,13 @@ public class ConfigBase {
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()));
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]