You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2024/09/21 05:02:36 UTC

(iotdb) branch master updated: [IOTDB-6351] Don't retry if operation has already succeed even if the DN is not running status

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

jackietien pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new a37b0edf12e [IOTDB-6351] Don't retry if operation has already succeed even if the DN is not running status
a37b0edf12e is described below

commit a37b0edf12e26fd4555739d754405b679669fa99
Author: Jackie Tien <ja...@gmail.com>
AuthorDate: Sat Sep 21 13:02:30 2024 +0800

    [IOTDB-6351] Don't retry if operation has already succeed even if the DN is not running status
---
 .../main/java/org/apache/iotdb/commons/utils/StatusUtils.java    | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/StatusUtils.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/StatusUtils.java
index ca7e7cd75cd..82232c6a0c9 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/StatusUtils.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/StatusUtils.java
@@ -206,13 +206,16 @@ public class StatusUtils {
   }
 
   public static boolean needRetry(TSStatus status) {
+    // succeed operation should never retry
+    if (status == null || status.getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
+      return false;
+    }
     // always retry while node is in not running case
     if (!COMMON_CONFIG.isRunning()) {
       return true;
-    } else if (status == null) {
-      return false;
+    } else {
+      return needRetryHelper(status);
     }
-    return needRetryHelper(status);
   }
 
   public static boolean needRetryHelper(TSStatus status) {