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

Yiqun Lin edited comment on HDFS-11935 at 6/6/17 12:35 PM:
-----------------------------------------------------------

Attach the patch.
One note: the line in the patch {{cluster.shutdown()}} is needed. Ran test 
under Windows system, the files cannot be deleted when current cluster is not 
shutdown then prepare to start  a new cluster instance. The error infos 
generated if I only replace the get host method:
{noformat}
java.io.IOException: Could not fully delete 
D:\work-project\hadoop\hadoop-hdfs-project\hadoop-hdfs\target\test\data\dfs\name-0-1
        at 
org.apache.hadoop.hdfs.MiniDFSCluster.configureNameService(MiniDFSCluster.java:994)
        at 
org.apache.hadoop.hdfs.MiniDFSCluster.createNameNodesAndSetConf(MiniDFSCluster.java:915)
        at 
org.apache.hadoop.hdfs.MiniDFSCluster.initMiniDFSCluster(MiniDFSCluster.java:847)
        at org.apache.hadoop.hdfs.MiniDFSCluster.<init>(MiniDFSCluster.java:491)
        at 
org.apache.hadoop.ozone.MiniOzoneCluster.<init>(MiniOzoneCluster.java:88)
        at 
org.apache.hadoop.ozone.MiniOzoneCluster.<init>(MiniOzoneCluster.java:85)
        at 
org.apache.hadoop.ozone.MiniOzoneCluster$Builder.build(MiniOzoneCluster.java:380)
        at 
org.apache.hadoop.ozone.TestStorageContainerManager.testRpcPermissionWithConf(TestStorageContainerManager.java:95)
        at 
org.apache.hadoop.ozone.TestStorageContainerManager.testRpcPermission(TestStorageContainerManager.java:86)
{noformat}



was (Author: linyiqun):
Attach the patch.
One note: the line in the patch {{cluster.shutdown()}} is needed. Ran test 
under Windows system, the files cannot be deleted when current cluster is not 
shutdown then prepare to start  a new cluster instance. The error infos:
{noformat}
java.io.IOException: Could not fully delete 
D:\work-project\hadoop\hadoop-hdfs-project\hadoop-hdfs\target\test\data\dfs\name-0-1
        at 
org.apache.hadoop.hdfs.MiniDFSCluster.configureNameService(MiniDFSCluster.java:994)
        at 
org.apache.hadoop.hdfs.MiniDFSCluster.createNameNodesAndSetConf(MiniDFSCluster.java:915)
        at 
org.apache.hadoop.hdfs.MiniDFSCluster.initMiniDFSCluster(MiniDFSCluster.java:847)
        at org.apache.hadoop.hdfs.MiniDFSCluster.<init>(MiniDFSCluster.java:491)
        at 
org.apache.hadoop.ozone.MiniOzoneCluster.<init>(MiniOzoneCluster.java:88)
        at 
org.apache.hadoop.ozone.MiniOzoneCluster.<init>(MiniOzoneCluster.java:85)
        at 
org.apache.hadoop.ozone.MiniOzoneCluster$Builder.build(MiniOzoneCluster.java:380)
        at 
org.apache.hadoop.ozone.TestStorageContainerManager.testRpcPermissionWithConf(TestStorageContainerManager.java:95)
        at 
org.apache.hadoop.ozone.TestStorageContainerManager.testRpcPermission(TestStorageContainerManager.java:86)
{noformat}


> Ozone: TestStorageContainerManager#testRpcPermission fails when ipv6 address 
> used
> ---------------------------------------------------------------------------------
>
>                 Key: HDFS-11935
>                 URL: https://issues.apache.org/jira/browse/HDFS-11935
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: test
>    Affects Versions: HDFS-7240
>            Reporter: Yiqun Lin
>            Assignee: Yiqun Lin
>         Attachments: HDFS-11935-HDFS-7240.001.patch
>
>
>  {{TestStorageContainerManager#testRpcPermission}} ran failed when ipv6 
> address used in my local. The stack infos:
> {noformat}
> java.lang.IllegalArgumentException: Does not contain a valid host:port 
> authority: 0:0:0:0:0:0:0:0:54846:9863
>       at org.apache.hadoop.net.NetUtils.createSocketAddr(NetUtils.java:213)
>       at org.apache.hadoop.net.NetUtils.createSocketAddr(NetUtils.java:164)
>       at org.apache.hadoop.net.NetUtils.createSocketAddr(NetUtils.java:153)
>       at 
> org.apache.hadoop.ozone.OzoneClientUtils.getScmAddressForBlockClients(OzoneClientUtils.java:193)
>       at 
> org.apache.hadoop.ozone.ksm.KeySpaceManager.getScmBlockClient(KeySpaceManager.java:117)
>       at 
> org.apache.hadoop.ozone.ksm.KeySpaceManager.<init>(KeySpaceManager.java:100)
>       at 
> org.apache.hadoop.ozone.MiniOzoneCluster$Builder.build(MiniOzoneCluster.java:373)
>       at 
> org.apache.hadoop.ozone.TestStorageContainerManager.testRpcPermissionWithConf(TestStorageContainerManager.java:95)
>       at 
> org.apache.hadoop.ozone.TestStorageContainerManager.testRpcPermission(TestStorageContainerManager.java:79)
> {noformat}
> {{OzoneClientUtils#getHostName}} will return a invalid host name when input 
> value is a ipv6 address.
> The root cause of this is that we use {{ListenerAddress}} which can be the 
> Iner6Address or Iner4Address instance}} to update address in 
> {{OzoneClientUtils#updateListenAddress}}.
> {code}
>   public static InetSocketAddress updateListenAddress(
>       OzoneConfiguration conf, String rpcAddressKey,
>       InetSocketAddress addr, RPC.Server rpcServer) {
>     InetSocketAddress listenAddr = rpcServer.getListenerAddress();
>     InetSocketAddress updatedAddr = new InetSocketAddress(
>        addr.getHostString(), listenAddr.getPort());
>     conf.set(rpcAddressKey,
>         listenAddr.getHostString() + ":" + listenAddr.getPort());
>     return updatedAddr;
>   }
> {code}
> We can use {{addr.getHostString() + ":" + listenAddr.getPort()}} to replace 
> {{listenAddr.getHostString() + ":" + listenAddr.getPort()}}. This way should 
> be okay since we just use configured address to start rpc server and the host 
> name should be same.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to