[ 
https://issues.apache.org/jira/browse/HDFS-10865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15496597#comment-15496597
 ] 

Rushabh S Shah commented on HDFS-10865:
---------------------------------------

I don't think that is the case.
{code:title=DatanodeManager.java|borderStyle=solid}
// Some comments here
public void registerDatanode(DatanodeRegistration nodeReg)
{
    ...
    DatanodeDescriptor nodeS = getDatanode(nodeReg.getDatanodeUuid());
    if (nodeS != null) {
      ...
      getNetworkTopology().add(nodeS);
      ...
      return;
    }
    DatanodeDescriptor nodeDescr 
      = new DatanodeDescriptor(nodeReg, NetworkTopology.DEFAULT_RACK);
    ...
    networktopology.add(nodeDescr);
}
{code}
So {{getNetworkTopology().add(nodeS);}} is only called if {{nodeS != null}}
At the end of the if condition, it will return.

[~elgoiri]: please correct me if my understanding is wrong.

> Datanodemanager adds nodes twice to NetworkTopology
> ---------------------------------------------------
>
>                 Key: HDFS-10865
>                 URL: https://issues.apache.org/jira/browse/HDFS-10865
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: datanode
>    Affects Versions: 2.7.3
>            Reporter: Inigo Goiri
>            Assignee: Inigo Goiri
>         Attachments: HDFS-10865.000.patch
>
>
> {{DatanodeManager}} tries to add datanodes to the {{NetworkTopology}} twice 
> in {{registerDatanode()}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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