This is an automated email from the ASF dual-hosted git repository. dataroaring 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 8e9eb1c0bf8 branch-3.0: [improve](cloud) adjust timeout settings for BE brpc connection pool to meta-service #44374 (#44578) 8e9eb1c0bf8 is described below commit 8e9eb1c0bf858a69f0f6fa6ef9f77f70fb54de5a Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> AuthorDate: Fri Nov 29 19:38:49 2024 +0800 branch-3.0: [improve](cloud) adjust timeout settings for BE brpc connection pool to meta-service #44374 (#44578) Cherry-picked from #44374 Co-authored-by: Luwei <lu...@selectdb.com> --- be/src/cloud/cloud_meta_mgr.cpp | 8 ++++---- be/src/cloud/config.cpp | 2 +- be/src/cloud/config.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/be/src/cloud/cloud_meta_mgr.cpp b/be/src/cloud/cloud_meta_mgr.cpp index 43c3517cd2d..bf32450b886 100644 --- a/be/src/cloud/cloud_meta_mgr.cpp +++ b/be/src/cloud/cloud_meta_mgr.cpp @@ -243,12 +243,12 @@ private: long deadline = now; // connection age only works without list endpoint. if (!is_meta_service_endpoint_list && - config::meta_service_connection_age_base_minutes > 0) { + config::meta_service_connection_age_base_seconds > 0) { std::default_random_engine rng(static_cast<uint32_t>(now)); std::uniform_int_distribution<> uni( - config::meta_service_connection_age_base_minutes, - config::meta_service_connection_age_base_minutes * 2); - deadline = now + duration_cast<milliseconds>(minutes(uni(rng))).count(); + config::meta_service_connection_age_base_seconds, + config::meta_service_connection_age_base_seconds * 2); + deadline = now + duration_cast<milliseconds>(seconds(uni(rng))).count(); } else { deadline = LONG_MAX; } diff --git a/be/src/cloud/config.cpp b/be/src/cloud/config.cpp index bdce09ed896..2d7be6b4971 100644 --- a/be/src/cloud/config.cpp +++ b/be/src/cloud/config.cpp @@ -28,7 +28,7 @@ DEFINE_Bool(meta_service_use_load_balancer, "false"); DEFINE_mInt32(meta_service_rpc_timeout_ms, "10000"); DEFINE_Bool(meta_service_connection_pooled, "true"); DEFINE_mInt64(meta_service_connection_pool_size, "20"); -DEFINE_mInt32(meta_service_connection_age_base_minutes, "5"); +DEFINE_mInt32(meta_service_connection_age_base_seconds, "30"); DEFINE_mInt32(meta_service_idle_connection_timeout_ms, "0"); DEFINE_mInt32(meta_service_rpc_retry_times, "200"); DEFINE_mInt32(meta_service_brpc_timeout_ms, "10000"); diff --git a/be/src/cloud/config.h b/be/src/cloud/config.h index 8af967afb8c..b345e635592 100644 --- a/be/src/cloud/config.h +++ b/be/src/cloud/config.h @@ -34,7 +34,7 @@ static inline bool is_cloud_mode() { // If meta services are deployed behind a load balancer, set this config to "host:port" of the load balancer. // Here is a set of configs to configure the connection behaviors: // - meta_service_connection_pooled: distribute the long connections to different RS of the VIP. -// - meta_service_connection_age_base_minutes: expire the connection after a random time during [base, 2*base], +// - meta_service_connection_age_base_seconds: expire the connection after a random time during [base, 2*base], // so that the BE has a chance to connect to a new RS. (When you add a new RS, the BE will connect to it) // - meta_service_idle_connection_timeout_ms: rebuild the idle connections after the timeout exceeds. Some LB // vendors will reset the connection if it is idle for a long time. @@ -50,7 +50,7 @@ DECLARE_mInt64(meta_service_connection_pool_size); // has a chance to connect to a new RS. Set zero to disable it. // // Only works when meta_service_endpoint is set to a single host. -DECLARE_mInt32(meta_service_connection_age_base_minutes); +DECLARE_mInt32(meta_service_connection_age_base_seconds); // Rebuild the idle connections after the timeout exceeds. Set zero to disable it. // // Only works when meta_service_endpoint is set to a single host. --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org