tomscut opened a new pull request #4067:
URL: https://github.com/apache/hadoop/pull/4067


   JIRA: [HDFS-16503](https://issues.apache.org/jira/browse/HDFS-16503). 
   
   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, 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](https://user-images.githubusercontent.com/55134131/158090641-88a81a28-d700-44c4-90e1-142be5b448cc.png)
   
   The same WebHDFS operations are: `CREATE`, `APPEND`, `OPEN`, 
`GETFILECHECKSUM`. So we can add `DFSUtil.isValidName` to `redirectURI` for 
`NamenodeWebHdfsMethods` and `RouterWebHdfsMethods`.


-- 
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]



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

Reply via email to