hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wang Xu (JIRA)" <j...@apache.org>
Subject [jira] Created: (HADOOP-5230) in FSNamesystem.registerDatanode, dnAddress should be resolved (rarely occured)
Date Thu, 12 Feb 2009 07:25:59 GMT
in FSNamesystem.registerDatanode, dnAddress should be resolved (rarely occured)
-------------------------------------------------------------------------------

                 Key: HADOOP-5230
                 URL: https://issues.apache.org/jira/browse/HADOOP-5230
             Project: Hadoop Core
          Issue Type: Bug
          Components: dfs
    Affects Versions: 0.21.0
         Environment: CentOS 5.2, JDK 1.6
            Reporter: Wang Xu
            Priority: Minor


In FSNamesystem.java registerDatanode(), if the datanode address cannot be
got from the RPC Server, it will use that from the datanode report:

    String dnAddress = Server.getRemoteAddress();
    if (dnAddress == null) {
      // Mostly called inside an RPC.
      // But if not, use address passed by the data-node.
      dnAddress = nodeReg.getHost();
    }      

The getHost() may return the hostname or address, while the Server.getRemoteAddress() 
will return the IP address, which is the dnAddress should be. Thus I think the it should be

    if (dnAddress == null) {
      // Mostly called inside an RPC.
      // But if not, use address passed by the data-node.
      dnAddress = InetAddress.getByName(nodeReg.getHost()).getHostAddress();
    }      

I know it should not be called in most situation, but I indeed use that, and I suppose the

dnAddress should be an IP address.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message