You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2022/04/15 01:26:31 UTC

[GitHub] [hadoop] tomscut commented on a diff in pull request #4170: HDFS-16540 Data locality is lost when DataNode pod restarts in kubern…

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


##########
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.getAddress()) ||

Review Comment:
   `nodeReg.getAddress()` contains port, but `nodeS.getIpAddr()` doesn't, so `updateHost2DatanodeMap` is always `true`, right?



-- 
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-unsubscribe@hadoop.apache.org

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


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