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 ca7e7cd75cdf..82232c6a0c92 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 static TSStatus getStatus(TSStatusCode statusCode) { } 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) {