This is an automated email from the ASF dual-hosted git repository.
tanxinyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 1940261bdce Fix AINode status error after ConfigNode Leader restarts
#13547
1940261bdce is described below
commit 1940261bdce51c1cb7b63b98b3cb8cde49eb6082
Author: Potato <[email protected]>
AuthorDate: Fri Sep 20 15:11:22 2024 +0800
Fix AINode status error after ConfigNode Leader restarts #13547
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);
+ });
}
/**