You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "Yukang-Lian (via GitHub)" <gi...@apache.org> on 2023/02/25 18:35:38 UTC

[GitHub] [doris] Yukang-Lian commented on a diff in pull request #17132: [Enhancement](stmt-forward) better error msg for follower fe

Yukang-Lian commented on code in PR #17132:
URL: https://github.com/apache/doris/pull/17132#discussion_r1117960780


##########
fe/fe-core/src/main/java/org/apache/doris/qe/MasterOpExecutor.java:
##########
@@ -127,19 +129,28 @@ private void forward() throws Exception {
 
         boolean isReturnToPool = false;
         try {
-            result = client.forward(params);
+            client.forward(params);
             isReturnToPool = true;
         } catch (TTransportException e) {
+            // wrap the raw exception.
+            Exception exception = new ForwardToMasterException(
+                    String.format("Forward statement %s to Master %s failed", ctx.getStmtId(),
+                            thriftAddress), e);
+
             boolean ok = ClientPool.frontendPool.reopen(client, thriftTimeoutMs);
             if (!ok) {
-                throw e;
+                throw exception;
             }
             if (shouldNotRetry || e.getType() == TTransportException.TIMED_OUT) {
-                throw e;
+                throw exception;
             } else {
                 LOG.warn("Forward statement " + ctx.getStmtId() + " to Master " + thriftAddress + " twice", e);
-                result = client.forward(params);
-                isReturnToPool = true;
+                try {
+                    client.forward(params);
+                    isReturnToPool = true;
+                } catch (TException ex) {

Review Comment:
   maybe use `e` so that the format is consistent with all exception?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org