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 03:03:09 UTC
(iotdb) 01/01: [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 IOTDB-6351
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 39a686eecd08f400e5e808a90776f0875072247e
Author: JackieTien97 <ja...@gmail.com>
AuthorDate: Sat Sep 21 11:02:53 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) {