elek 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_r330472747
 
 

 ##########
 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:
   I am trying to understand why this big block is not just as simple:
   
   ```
         Node client = null;
         List<DatanodeDetails> possibleClients =
             nodeManager.getNodesByAddress(clientMachine);
         if (possibleClients.size()>0){
           client = possibleClients.get(0);
         }
   ```
   
   It seems to be a logic to find a datanode which is on the same host as the 
client. I am not sure if we need this tricky randomization (or choosing the 
first possible datanodes): if client is null, we don't need sort (handled by 
the sort method below), if there are multiple datanodes on the same client we 
can choose the first one as in the topology sort it doesn't matter which one is 
chosen.
   
   But please fix me if I am wrong.

----------------------------------------------------------------
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]

Reply via email to