You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ta...@apache.org on 2024/09/19 09:01:23 UTC

(iotdb) branch fix_confignode_restart_ainode_error created (now 5e08f83c6d0)

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

tanxinyu pushed a change to branch fix_confignode_restart_ainode_error
in repository https://gitbox.apache.org/repos/asf/iotdb.git


      at 5e08f83c6d0 finish

This branch includes the following new commits:

     new 5e08f83c6d0 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 ta...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tanxinyu pushed a commit to branch fix_confignode_restart_ainode_error
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 5e08f83c6d0ed7fe825f40ce8ee1ff0458be95b9
Author: OneSizeFitQuorum <ta...@apache.org>
AuthorDate: Thu Sep 19 17:01:05 2024 +0800

    finish
    
    Signed-off-by: OneSizeFitQuorum <ta...@apache.org>
---
 .../iotdb/confignode/manager/load/cache/LoadCache.java     | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/cache/LoadCache.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/cache/LoadCache.java
index 8fe7233809d..137a8b7f63e 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/cache/LoadCache.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/cache/LoadCache.java
@@ -19,6 +19,7 @@
 
 package org.apache.iotdb.confignode.manager.load.cache;
 
+import org.apache.iotdb.common.rpc.thrift.TAINodeConfiguration;
 import org.apache.iotdb.common.rpc.thrift.TConfigNodeLocation;
 import org.apache.iotdb.common.rpc.thrift.TConsensusGroupId;
 import org.apache.iotdb.common.rpc.thrift.TConsensusGroupType;
@@ -98,7 +99,8 @@ public class LoadCache {
   public void initHeartbeatCache(IManager configManager) {
     initNodeHeartbeatCache(
         configManager.getNodeManager().getRegisteredConfigNodes(),
-        configManager.getNodeManager().getRegisteredDataNodes());
+        configManager.getNodeManager().getRegisteredDataNodes(),
+        configManager.getNodeManager().getRegisteredAINodes());
     initRegionGroupHeartbeatCache(
         configManager.getClusterSchemaManager().getDatabaseNames().stream()
             .collect(
@@ -110,7 +112,8 @@ public class LoadCache {
   /** Initialize the nodeCacheMap when the ConfigNode-Leader is switched. */
   private void initNodeHeartbeatCache(
       List<TConfigNodeLocation> registeredConfigNodes,
-      List<TDataNodeConfiguration> registeredDataNodes) {
+      List<TDataNodeConfiguration> registeredDataNodes,
+      List<TAINodeConfiguration> registeredAINodes) {
 
     final int CURRENT_NODE_ID = ConfigNodeHeartbeatCache.CURRENT_NODE_ID;
     nodeCacheMap.clear();
@@ -136,6 +139,13 @@ public class LoadCache {
           int dataNodeId = dataNodeConfiguration.getLocation().getDataNodeId();
           createNodeHeartbeatCache(NodeType.DataNode, dataNodeId);
         });
+
+    // Init AiNodeHeartbeatCache
+    registeredAINodes.forEach(
+        aiNodeConfiguration -> {
+          int aiNodeId = aiNodeConfiguration.getLocation().getAiNodeId();
+          createNodeHeartbeatCache(NodeType.AINode, aiNodeId);
+        });
   }
 
   /**