This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 0b28420e1c6 [pick](Variant) make remote schema fetch rpc timeout 
configurable (#35296) (#36174)
0b28420e1c6 is described below

commit 0b28420e1c6857ff636eba36614531d61c9394b6
Author: lihangyu <[email protected]>
AuthorDate: Wed Jun 12 19:51:53 2024 +0800

    [pick](Variant) make remote schema fetch rpc timeout configurable (#35296) 
(#36174)
---
 be/src/common/config.cpp                                            | 3 +++
 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, 15 insertions(+), 1 deletion(-)

diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp
index cf4ec79f07c..d090b3a451a 100644
--- a/be/src/common/config.cpp
+++ b/be/src/common/config.cpp
@@ -1230,6 +1230,9 @@ DEFINE_mBool(skip_loading_stale_rowset_meta, "false");
 
 DEFINE_Bool(enable_file_logger, "true");
 
+// 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
 // test s3
diff --git a/be/src/common/config.h b/be/src/common/config.h
index 55bee9e17ce..61e0e2673b7 100644
--- a/be/src/common/config.h
+++ b/be/src/common/config.h
@@ -1313,6 +1313,8 @@ DECLARE_mBool(skip_loading_stale_rowset_meta);
 // Disable this option will no longer use file to record log.
 // Only works when starting BE with --console.
 DECLARE_Bool(enable_file_logger);
+// 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 f9f788a1184..76c86218bb1 100644
--- a/be/src/service/internal_service.cpp
+++ b/be/src/service/internal_service.cpp
@@ -1084,6 +1084,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 376e58222ab..471d7cd086d 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
@@ -571,6 +571,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";
@@ -1783,6 +1785,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]

Reply via email to