sodonnel commented on a change in pull request #2377:
URL: https://github.com/apache/ozone/pull/2377#discussion_r660744396
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/states/NodeStateMap.java
##########
@@ -79,7 +86,10 @@ public void addNode(DatanodeDetails datanodeDetails,
NodeStatus nodeStatus)
if (nodeMap.containsKey(id)) {
throw new NodeAlreadyExistsException("Node UUID: " + id);
}
- nodeMap.put(id, new DatanodeInfo(datanodeDetails, nodeStatus));
+ DatanodeInfo datanodeInfo = new DatanodeInfo(datanodeDetails,
nodeStatus);
+ // Make sure nodes in topology tree has all DN info.
+ clusterMap.add(datanodeInfo);
+ nodeMap.put(id, datanodeInfo);
Review comment:
The node is already added to the cluster map on registration in
`SCMNodeManager.register(...)`:
```
@Override
public RegisteredCommand register(
DatanodeDetails datanodeDetails, NodeReportProto nodeReport,
PipelineReportsProto pipelineReportsProto) {
...
networkLocation = nodeResolve(dnsName);
if (networkLocation != null) {
datanodeDetails.setNetworkLocation(networkLocation);
}
clusterMap.add(datanodeDetails);
nodeStateManager.addNode(datanodeDetails);
...
```
Why do we need to add it again here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]