[
https://issues.apache.org/jira/browse/HDFS-16503?focusedWorklogId=740914&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-740914
]
ASF GitHub Bot logged work on HDFS-16503:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 14/Mar/22 14:36
Start Date: 14/Mar/22 14:36
Worklog Time Spent: 10m
Work Description: tomscut commented on a change in pull request #4067:
URL: https://github.com/apache/hadoop/pull/4067#discussion_r826018545
##########
File path:
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHDFS.java
##########
@@ -522,6 +523,38 @@ public void testCreateWithNoDN() throws Exception {
}
}
+ @Test
+ public void testWebHdfsCreateWithInvalidPath() throws Exception {
+ final Configuration conf = WebHdfsTestUtil.createConf();
+ cluster = new MiniDFSCluster.Builder(conf).numDataNodes(1).build();
Review comment:
> do you need a datanode, if you aren't writing any data, you can
survive with 0 datanodes as well? btw if not, the default is 1 only, you don't
need to explicitly put one there. IIRC
Thanks you @ayushtkn very much for the review. I fixed it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 740914)
Time Spent: 50m (was: 40m)
> Should verify whether the path name is valid in the WebHDFS
> -----------------------------------------------------------
>
> Key: HDFS-16503
> URL: https://issues.apache.org/jira/browse/HDFS-16503
> Project: Hadoop HDFS
> Issue Type: Bug
> Reporter: tomscut
> Assignee: tomscut
> Priority: Major
> Labels: pull-request-available
> Attachments: image-2022-03-14-09-35-49-860.png
>
> Time Spent: 50m
> Remaining Estimate: 0h
>
> When creating a file using WebHDFS, there are two main steps:
> 1. Obtain the location of the Datanode to be written.
> 2. Put the file to this location.
> Currently *NameNodeRpcServer* verifies that pathName is valid, but
> *NamenodeWebHdfsMethods* and *RouterWebHdfsMethods* do not.
> So if we use an invalid path(such as duplicated slash), the first step
> returns success, but the second step throws an {*}InvalidPathException{*}.
> IMO, we should also do the validation in WebHdfs, which is consistent with
> the NameNodeRpcServer.
> !image-2022-03-14-09-35-49-860.png|width=548,height=164!
> The same webHDFS operations are: CREATE, APPEND, OPEN, GETFILECHECKSUM. So we
> can add DFSUtil.isValidName to redirectURI for *NamenodeWebHdfsMethods* and
> *RouterWebHdfsMethods.*
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]