Siyao Meng created HDFS-18003:
---------------------------------

             Summary: RBF: federation rename journal path fails to parse for an 
IPv6 listener address
                 Key: HDFS-18003
                 URL: https://issues.apache.org/jira/browse/HDFS-18003
             Project: Hadoop HDFS
          Issue Type: Bug
          Components: rbf
            Reporter: Siyao Meng
            Assignee: Siyao Meng


With {{dfs.federation.router.federation.rename.option=DISTCP}}, 
{{RouterRpcServer.initRouterFedRename}} names the journal directory after the 
RPC listener address when the Router has no NameNode nameservice or namenode 
ID, which is the usual case for a Router that does not run on a NameNode host 
([RouterRpcServer.java:670|https://github.com/apache/hadoop/blob/1097744bc490b65cad5ab2fbeafff35687971357/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java#L670]):

{code:java}
child = new Path(
    listenAddress.getHostName() + "_" + listenAddress.getPort());
{code}

With {{dfs.federation.router.rpc-address=[::]:8888}} the host is 
{{0:0:0:0:0:0:0:0}}; a specific IPv6 address without a PTR record gives the 
literal. {{Path(String)}} treats the text before the first {{:}} as a URI 
scheme and throws {{IllegalArgumentException}} ("Relative path in absolute 
URI"). {{initRouterFedRename}} runs in the {{RouterRpcServer}} constructor, so 
the Router does not start. The IPv4 form in the code comment, 
{{/journal/0.0.0.0_8888}}, works.

Verified by reading the code, and with a standalone copy of the trunk 
{{Path(String)}} parsing on JDK 21, which throws for {{0:0:0:0:0:0:0:0_8888}} 
and {{2001:db8:0:0:0:0:0:20_8888}} and accepts {{0.0.0.0_8888}}. Not run with 
the real {{Path}} class or a Router.

*Proposed fix:* replace {{:}} in the host before building the path component. 
Leave IPv4 addresses and host names unchanged, so existing journal directories 
are still found.

POC: 
https://github.com/smengcl/hadoop/commit/daab9184f1b0818161b3c53a50753aaaefb9f568



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to