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

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


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

commit 0561c0d3fb3a3efc3bf42ba013c8d351d297017b
Author: Jackie Tien <[email protected]>
AuthorDate: Sat Sep 21 13:02:16 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) {

Reply via email to