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

morningman 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 a4ed2002ac1 [fix](heartbeat) fill default value for required field in 
TFrontendPingFrontendResult (#41609)
a4ed2002ac1 is described below

commit a4ed2002ac1eea25d780c673ea1a6af1da2808fa
Author: Mingyu Chen <[email protected]>
AuthorDate: Fri Oct 11 18:12:52 2024 +0800

    [fix](heartbeat) fill default value for required field in 
TFrontendPingFrontendResult (#41609)
    
    Otherwise, if ping failed, some of required fields are not set, causing
    some unexpected error log like:
    
    
![img_v3_02ff_a120257d-1614-4e33-9b4a-1cbe33eb84dg](https://github.com/user-attachments/assets/0e933fab-b541-4b6a-ba95-264b282354c7)
---
 .../main/java/org/apache/doris/service/FrontendServiceImpl.java    | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java 
b/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
index 8d5ad445043..f592a20f84d 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
@@ -2232,7 +2232,14 @@ public class FrontendServiceImpl implements 
FrontendService.Iface {
     public TFrontendPingFrontendResult ping(TFrontendPingFrontendRequest 
request) throws TException {
         boolean isReady = Env.getCurrentEnv().isReady();
         TFrontendPingFrontendResult result = new TFrontendPingFrontendResult();
+        // The following fields are required in thrift.
+        // So must give them a default value to avoid "Required field xx was 
not present" error.
         result.setStatus(TFrontendPingFrontendStatusCode.OK);
+        result.setMsg("");
+        result.setQueryPort(0);
+        result.setRpcPort(0);
+        result.setReplayedJournalId(0);
+        result.setVersion(Version.DORIS_BUILD_VERSION + "-" + 
Version.DORIS_BUILD_SHORT_HASH);
         if (isReady) {
             if (request.getClusterId() != Env.getCurrentEnv().getClusterId()) {
                 result.setStatus(TFrontendPingFrontendStatusCode.FAILED);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to