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.