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
commit abde3632d135d0f2f5b24c58f8d689f4f935b4dd Author: lihangyu <[email protected]> AuthorDate: Tue May 28 11:38:17 2024 +0800 [Config](Variant) make remote schema fetch rpc timeout configurable (#35296) --- be/src/common/config.cpp | 2 ++ be/src/common/config.h | 2 ++ be/src/service/internal_service.cpp | 1 + .../org/apache/doris/common/util/FetchRemoteTabletSchemaUtil.java | 4 +++- fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java | 6 ++++++ 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp index 6a4cd152a1b..610d5492aa7 100644 --- a/be/src/common/config.cpp +++ b/be/src/common/config.cpp @@ -1275,6 +1275,8 @@ DEFINE_Int64(max_nonblock_close_thread_num, "64"); // The possibility that mem allocator throws an exception during memory allocation // This config is for test usage, be careful when changing it. DEFINE_mDouble(mem_alloc_fault_probability, "0.0"); +// The time out milliseconds for remote fetch schema RPC, default 60s +DEFINE_mInt64(fetch_remote_schema_rpc_timeout_ms, "60000"); // clang-format off #ifdef BE_TEST diff --git a/be/src/common/config.h b/be/src/common/config.h index a53c985de36..ffec61770fd 100644 --- a/be/src/common/config.h +++ b/be/src/common/config.h @@ -1352,6 +1352,8 @@ DECLARE_Int64(max_nonblock_close_thread_num); // The possibility that mem allocator throws an exception during memory allocation // This config is for test usage, be careful when changing it. DECLARE_mDouble(mem_alloc_fault_probability); +// The time out milliseconds for remote fetch schema RPC +DECLARE_mInt64(fetch_remote_schema_rpc_timeout_ms); #ifdef BE_TEST // test s3 diff --git a/be/src/service/internal_service.cpp b/be/src/service/internal_service.cpp index 338b8b5fb9c..c8f48e79988 100644 --- a/be/src/service/internal_service.cpp +++ b/be/src/service/internal_service.cpp @@ -1065,6 +1065,7 @@ void PInternalServiceImpl::fetch_remote_tablet_schema(google::protobuf::RpcContr ExecEnv::GetInstance()->brpc_internal_client_cache()->get_client( host, brpc_port)); rpc_contexts[i].cid = rpc_contexts[i].cntl.call_id(); + rpc_contexts[i].cntl.set_timeout_ms(config::fetch_remote_schema_rpc_timeout_ms); stub->fetch_remote_tablet_schema(&rpc_contexts[i].cntl, &remote_request, &rpc_contexts[i].response, brpc::DoNothing()); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/common/util/FetchRemoteTabletSchemaUtil.java b/fe/fe-core/src/main/java/org/apache/doris/common/util/FetchRemoteTabletSchemaUtil.java index 808b4b2a552..db9700f7448 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/common/util/FetchRemoteTabletSchemaUtil.java +++ b/fe/fe-core/src/main/java/org/apache/doris/common/util/FetchRemoteTabletSchemaUtil.java @@ -32,6 +32,7 @@ import org.apache.doris.proto.InternalService.PFetchRemoteSchemaResponse; import org.apache.doris.proto.InternalService.PTabletsLocation; import org.apache.doris.proto.OlapFile.ColumnPB; import org.apache.doris.proto.OlapFile.TabletSchemaPB; +import org.apache.doris.qe.ConnectContext; import org.apache.doris.rpc.BackendServiceProxy; import org.apache.doris.rpc.RpcException; import org.apache.doris.system.Backend; @@ -116,7 +117,8 @@ public class FetchRemoteTabletSchemaUtil { .fetchRemoteTabletSchemaAsync(be.getBrpcAddress(), request); PFetchRemoteSchemaResponse response = null; try { - response = future.get(60, TimeUnit.SECONDS); + response = future.get( + ConnectContext.get().getSessionVariable().fetchRemoteSchemaTimeoutSeconds, TimeUnit.SECONDS); TStatusCode code = TStatusCode.findByValue(response.getStatus().getStatusCode()); String errMsg; if (code != TStatusCode.OK) { diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java index a966d85ca4a..44cb076d3ed 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java @@ -584,6 +584,8 @@ public class SessionVariable implements Serializable, Writable { public static final String LIMIT_ROWS_FOR_SINGLE_INSTANCE = "limit_rows_for_single_instance"; + public static final String FETCH_REMOTE_SCHEMA_TIMEOUT_SECONDS = "fetch_remote_schema_timeout_seconds"; + // CLOUD_VARIABLES_BEGIN public static final String CLOUD_CLUSTER = "cloud_cluster"; public static final String DISABLE_EMPTY_PARTITION_PRUNE = "disable_empty_partition_prune"; @@ -1823,6 +1825,10 @@ public class SessionVariable implements Serializable, Writable { @VariableMgr.VarAttr(name = MIN_REVOCABLE_MEM, fuzzy = true) public long minRevocableMem = 32 * 1024 * 1024; + // fetch remote schema rpc timeout + @VariableMgr.VarAttr(name = FETCH_REMOTE_SCHEMA_TIMEOUT_SECONDS, fuzzy = true) + public long fetchRemoteSchemaTimeoutSeconds = 120; + @VariableMgr.VarAttr( name = ENABLE_JOIN_SPILL, description = {"控制是否启用join算子落盘。默认为 false。", --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
