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

yongzao pushed a commit to branch optimize-AIN-rm-log
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit b8b82087ebf662db2958fa63dac61bd05389a644
Author: Yongzao <[email protected]>
AuthorDate: Fri Feb 6 12:05:15 2026 +0800

    finish
---
 .../iotdb/confignode/manager/node/NodeManager.java      |  2 +-
 .../config/executor/ClusterConfigTaskExecutor.java      | 17 +++++++++--------
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git 
a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/node/NodeManager.java
 
b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/node/NodeManager.java
index 0c1d409cc70..e3d775259d6 100644
--- 
a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/node/NodeManager.java
+++ 
b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/node/NodeManager.java
@@ -558,7 +558,7 @@ public class NodeManager {
   public TSStatus removeAINode() {
     // check if the node exists
     if (nodeInfo.getRegisteredAINodes().isEmpty()) {
-      return new TSStatus(TSStatusCode.REMOVE_AI_NODE_ERROR.getStatusCode())
+      return new 
TSStatus(TSStatusCode.NO_REGISTERED_AI_NODE_ERROR.getStatusCode())
           .setMessage("Remove AINode failed because there is no AINode in the 
cluster.");
     }
 
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java
index 52c85334c18..fbed84753cd 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java
@@ -3550,15 +3550,16 @@ public class ClusterConfigTaskExecutor implements 
IConfigTaskExecutor {
     LOGGER.info("Starting to remove AINode");
     try (ConfigNodeClient configNodeClient =
         
CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.CONFIG_REGION_ID)) {
-      TShowClusterResp showClusterResp = configNodeClient.showCluster();
-      if (showClusterResp.getAiNodeListSize() < 1) {
-        LOGGER.error("Remove AINode failed because there is no AINode in the 
cluster.");
-        future.setException(
-            new IOException("Remove AINode failed because there is no AINode 
in the cluster."));
-        return future;
-      }
       TSStatus status = configNodeClient.removeAINode(new TAINodeRemoveReq());
-      if (status.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
+      if (status.getCode() == 
TSStatusCode.NO_REGISTERED_AI_NODE_ERROR.getStatusCode()) {
+        LOGGER.warn("Remove AINode failed because there is no AINode in the 
cluster.");
+        future.set(
+            new ConfigTaskResult(
+                new 
TSStatus(TSStatusCode.NO_REGISTERED_AI_NODE_ERROR.getStatusCode())
+                    .setMessage(
+                        "Remove AINode failed because there is no AINode in 
the cluster.")));
+        return future;
+      } else if (status.getCode() != 
TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
         future.setException(new IOException("Remove AINode failed: " + 
status.getMessage()));
         return future;
       } else {

Reply via email to