[ 
https://issues.apache.org/jira/browse/HDFS-16540?focusedWorklogId=761022&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-761022
 ]

ASF GitHub Bot logged work on HDFS-16540:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 22/Apr/22 18:55
            Start Date: 22/Apr/22 18:55
    Worklog Time Spent: 10m 
      Work Description: huaxiangsun commented on code in PR #4170:
URL: https://github.com/apache/hadoop/pull/4170#discussion_r856493317


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeManager.java:
##########
@@ -1189,16 +1190,25 @@ 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.getXferAddr().equals(nodeReg.getXferAddr());

Review Comment:
   Yeah, since nodeS is not null, nodeS.getXferAddr() cannot be null.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 761022)
    Time Spent: 2h 20m  (was: 2h 10m)

> Data locality is lost when DataNode pod restarts in kubernetes 
> ---------------------------------------------------------------
>
>                 Key: HDFS-16540
>                 URL: https://issues.apache.org/jira/browse/HDFS-16540
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: namenode
>    Affects Versions: 3.3.2
>            Reporter: Huaxiang Sun
>            Assignee: Huaxiang Sun
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> We have HBase RegionServer and Hdfs DataNode running in one pod. When the pod 
> restarts, we found that data locality is lost after we do a major compaction 
> of hbase regions. After some debugging, we found that upon pod restarts, its 
> ip changes. In DatanodeManager, maps like networktopology are updated with 
> the new info. host2DatanodeMap is not updated accordingly. When hdfs client 
> with the new ip tries to find a local DataNode, it fails. 
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

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

Reply via email to