tomscut commented on code in PR #4170:
URL: https://github.com/apache/hadoop/pull/4170#discussion_r851582741


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeManager.java:
##########
@@ -1189,16 +1190,26 @@ public void registerDatanode(DatanodeRegistration 
nodeReg)
             nodes with its data cleared (or user can just remove the StorageID
             value in "VERSION" file under the data directory of the datanode,
             but this is might not work if VERSION file format has changed 
-         */        
+         */
+          // Check if nodeS's host information is same as nodeReg's, if not,
+          // it needs to update host2DatanodeMap accordringly.
+          updateHost2DatanodeMap = 
!nodeS.getIpAddr().equals(nodeReg.getIpAddr()) ||
+                  (nodeS.getXferPort() != nodeReg.getXferPort());
+

Review Comment:
   Can we update 
   `updateHost2DatanodeMap = !nodeS.getIpAddr().equals(nodeReg.getIpAddr()) ||
                     (nodeS.getXferPort() != nodeReg.getXferPort());`
   to
   `updateHost2DatanodeMap = 
!nodeS.getXferAddr().equals(nodeReg.getXferAddr());`



-- 
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: common-issues-unsubscr...@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to