You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by yo...@apache.org on 2026/02/06 04:05:27 UTC

(iotdb) branch optimize-AIN-rm-log created (now b8b82087ebf)

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

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


      at b8b82087ebf finish

This branch includes the following new commits:

     new b8b82087ebf finish

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(iotdb) 01/01: finish

Posted by yo...@apache.org.
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 <53...@qq.com>
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 {