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 <[email protected]> AuthorDate: Thu Sep 19 17:01:05 2024 +0800 finish Signed-off-by: OneSizeFitQuorum <[email protected]> --- .../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); + }); } /**
