sodonnel commented on a change in pull request #1551: HDDS-2199 In
SCMNodeManager dnsToUuidMap cannot track multiple DNs on the same host
URL: https://github.com/apache/hadoop/pull/1551#discussion_r330585159
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMBlockProtocolServer.java
##########
@@ -295,7 +297,33 @@ public ScmInfo getScmInfo() throws IOException {
boolean auditSuccess = true;
try{
NodeManager nodeManager = scm.getScmNodeManager();
- Node client = nodeManager.getNodeByAddress(clientMachine);
Review comment:
Looking at where sortDatanodes() is used, it seems to be from the OM when
performing lookup file or lookup key. So that suggests it is only used in the
read path, and hence at most 3 DNs should be passed in along with one client
address.
The code could be simplified a little, but I think we do need to filter the
list of returned nodes down to only the nodes it cares about due to what I said
in the comment above.
However, thinking about this some more, I think we can avoid the random
selection. In the case where there is only 1 DN per host, the DN matching the
client would always be sorted first, so we don't really need to randomize the
first node returned if all nodes are on the same host. I will refactor this and
see how it looks then.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]