This is an automated email from the ASF dual-hosted git repository.
gavinchou pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.0 by this push:
new bc37ec55c94 branch-3.0: [opt](cloud) Add config
enable_meta_service_endpoint_consistency_check #49264 (#49362)
bc37ec55c94 is described below
commit bc37ec55c94f8ad6f69631547143fb1a5d0aad35
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Mon Mar 24 11:32:44 2025 +0800
branch-3.0: [opt](cloud) Add config
enable_meta_service_endpoint_consistency_check #49264 (#49362)
Cherry-picked from #49264
Co-authored-by: Gavin Chou <[email protected]>
---
be/src/agent/heartbeat_server.cpp | 9 +++++----
be/src/cloud/config.cpp | 1 +
be/src/cloud/config.h | 3 +++
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/be/src/agent/heartbeat_server.cpp
b/be/src/agent/heartbeat_server.cpp
index 11345ea06f0..0cb6bea2220 100644
--- a/be/src/agent/heartbeat_server.cpp
+++ b/be/src/agent/heartbeat_server.cpp
@@ -256,18 +256,19 @@ Status HeartbeatServer::_heartbeat(const TMasterInfo&
master_info) {
if (config::meta_service_endpoint.empty() &&
!master_info.meta_service_endpoint.empty()) {
auto st = config::set_config("meta_service_endpoint",
master_info.meta_service_endpoint,
true);
- LOG(INFO) << "set config meta_service_endpoing " <<
master_info.meta_service_endpoint
+ LOG(INFO) << "set config meta_service_endpoint " <<
master_info.meta_service_endpoint
<< " " << st;
}
- if (master_info.meta_service_endpoint !=
config::meta_service_endpoint) {
+ if (master_info.meta_service_endpoint != config::meta_service_endpoint
&&
+ config::enable_meta_service_endpoint_consistency_check) {
LOG(WARNING) << "Detected mismatch in meta_service_endpoint
configuration between FE "
"and BE. "
<< "FE meta_service_endpoint: " <<
master_info.meta_service_endpoint
<< ", BE meta_service_endpoint: " <<
config::meta_service_endpoint;
return Status::InvalidArgument<false>(
- "fe and be do not work in same mode, fe
meta_service_endpoint: {},"
- " be meta_service_endpoint: {}",
+ "fe and be do not work in same mode or
meta_service_endpoint mismatch,"
+ "fe meta_service_endpoint: {}, be meta_service_endpoint:
{}",
master_info.meta_service_endpoint,
config::meta_service_endpoint);
}
}
diff --git a/be/src/cloud/config.cpp b/be/src/cloud/config.cpp
index 4dee3002e3a..84df8c016e7 100644
--- a/be/src/cloud/config.cpp
+++ b/be/src/cloud/config.cpp
@@ -25,6 +25,7 @@ namespace doris::config {
DEFINE_String(deploy_mode, "");
DEFINE_mString(cloud_unique_id, "");
DEFINE_mString(meta_service_endpoint, "");
+DEFINE_mBool(enable_meta_service_endpoint_consistency_check, "true");
DEFINE_Bool(meta_service_use_load_balancer, "false");
DEFINE_mInt32(meta_service_rpc_timeout_ms, "10000");
DEFINE_Bool(meta_service_connection_pooled, "true");
diff --git a/be/src/cloud/config.h b/be/src/cloud/config.h
index f79038662ef..72151b9ce64 100644
--- a/be/src/cloud/config.h
+++ b/be/src/cloud/config.h
@@ -44,6 +44,9 @@ static inline bool is_cloud_mode() {
// separated by a comma, like "host:port,host:port,host:port", then BE will
choose a server to connect in randomly.
// In this mode, The config meta_service_connection_pooled is still useful,
but the other two configs will be ignored.
DECLARE_mString(meta_service_endpoint);
+// Whether check config::meta_service_endpoint is identical to the ms endpoint
from FE master heartbeat
+// This may help in some cases that we intend to change the config only FE
side or BE side
+DECLARE_mBool(enable_meta_service_endpoint_consistency_check);
// Set the underlying connection type to pooled.
DECLARE_Bool(meta_service_connection_pooled);
DECLARE_mInt64(meta_service_connection_pool_size);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]