[IOTDB-4140] Mark the datanode as removing status when execute remove-datanode.sh#7008
[IOTDB-4140] Mark the datanode as removing status when execute remove-datanode.sh#7008qiaojialin merged 10 commits intomasterfrom
Conversation
| return false; | ||
| } | ||
|
|
||
| public void setNodeRemoving(int dataNodeId) { |
There was a problem hiding this comment.
TODO: add a interface, set node removing is false.
if procedure failed and rollback.
There was a problem hiding this comment.
change method from setNodeRemovingStatus(int dataNodeId) to setNodeRemovingStatus(int dataNodeId, boolean isRemoving)
CRZbulabula
left a comment
There was a problem hiding this comment.
PTAL. Besides the comments above, we should better special treat the updateLoadStatistic() operation on the Removing DataNode. Because they might trigger newer broadcast of RegionRouteMap, which will replace previous broadcast map.
| // TODO: This class might be split into DataNodeCache and ConfigNodeCache | ||
| // when the response time of heartbeat is more than 20s, | ||
| // the datanode is considered as down | ||
| private static final int HEARTBEAT_TIMEOUT_TIME = 20_000; |
There was a problem hiding this comment.
The HEARTBEAT_TIMEOUT_TIME can be moved to INodeCache since it's also used in ConfigNodeHeartbeatCache
There was a problem hiding this comment.
fixed. and I think changing INodeCache from Interface to Abstract class is better. Because some variables are common used.
| int leaderDataNodeId = regionGroupCache.getLeaderDataNodeId(); | ||
| if (!configManager.getNodeManager().isNodeRemoving(leaderDataNodeId)) { | ||
| result.put(consensusGroupId, leaderDataNodeId); | ||
| } |
There was a problem hiding this comment.
We'd better put -1 instead of nothing when the leaderNode happens to be in the status of Removing. This might avoid NPE.
| (consensusGroupId, regionGroupCache) -> { | ||
| int leaderDataNodeId = regionGroupCache.getLeaderDataNodeId(); | ||
| if (!configManager.getNodeManager().isNodeRemoving(leaderDataNodeId)) { | ||
| result.put(consensusGroupId, leaderDataNodeId); | ||
| } |
There was a problem hiding this comment.
We'd better put -1 instead of nothing when the leaderNode happens to be in the status of Removing. This might avoid NPE.
…iotdb into beyyes/remove_datanode_precedure
|
SonarCloud Quality Gate failed. |








Description
When executed remove-datanode.sh TARGET_NODE, the node status of TARGET_NODE should be marked as
REMOVING, and the LatestRegionRouteMap should be broadcasted to assure that no more read/write requests are forwarded to this datanode.Running screenshots
1). 1 confignode and 4 datanodes.


2). after execute remove-datanode.sh 127.0.0.1:6669
In

REMOVE_DATA_NODE_PREPAREstate ofRemoveDataNodeProcedure,the region map order is [3,1,2] rather than [2,3,1]
When remove-datanode.sh is executed completely.


The mainly changed are this method.

TODO:
change the datanode status when RemoveDataNodeProcedure is completed