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

Inigo Goiri commented on HDFS-10865:
------------------------------------

[~shahrs87], that's the code path to update a node that was already in the 
cluster ({{nodeS != null}}).
However, if this is a fresh node, we first execute line 1051 (the one in your 
comment):
This is the code:
{code}
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);

    nodeDescr.setSoftwareVersion(nodeReg.getSoftwareVersion());
    resolveUpgradeDomain(nodeDescr);

    // register new datanode
    addDatanode(nodeDescr);
    ...
}

void addDatanode(final DatanodeDescriptor node) {
    ...
    networktopology.add(node); // may throw InvalidTopologyException
    host2DatanodeMap.add(node);
    checkIfClusterIsNowMultiRack(node);
    resolveUpgradeDomain(node);
    ...
}
{code}


> 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