You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Suresh Srinivas (JIRA)" <ji...@apache.org> on 2010/11/18 20:42:15 UTC

[jira] Commented: (HDFS-1109) HFTP and URL Encoding

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

Suresh Srinivas commented on HDFS-1109:
---------------------------------------

Goto namenode web UI -> Browse the filesystem -> click on a file link.

The URL sends the file name as the URL param. However the change made in this patch (see below), looks for filename in URL path.

{noformat}
Index: src/java/org/apache/hadoop/hdfs/server/datanode/DatanodeJspHelper.java
===================================================================
--- src/java/org/apache/hadoop/hdfs/server/datanode/DatanodeJspHelper.java	(revision 938218)
+++ src/java/org/apache/hadoop/hdfs/server/datanode/DatanodeJspHelper.java	(working copy)
@@ -236,7 +236,9 @@
     else
       startOffset = Long.parseLong(startOffsetStr);
 
-    final String filename=JspHelper.validatePath(req.getParameter("filename"));
+    final String filename=JspHelper.validatePath(
+                          req.getPathInfo() == null ? 
+                          "/" : req.getPathInfo());

{noformat}


Why are we using URL path instead of "filename" param?

> HFTP and URL Encoding
> ---------------------
>
>                 Key: HDFS-1109
>                 URL: https://issues.apache.org/jira/browse/HDFS-1109
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: contrib/hdfsproxy, data-node
>    Affects Versions: 0.20.1, 0.20.2, 0.20.3, 0.21.0, 0.22.0
>            Reporter: Dmytro Molkov
>            Assignee: Dmytro Molkov
>             Fix For: 0.22.0
>
>         Attachments: HDFS-1109.2.patch, HDFS-1109.2_y0.20.1xx.patch, HDFS-1109.2_y0.20.1xx_incremental.patch, HDFS-1109.patch
>
>
> We just saw this error happen in our cluster. If there is a file that has a "+" sign in the name it is not readable through HFTP protocol.
> The problem is when we are reading a file with HFTP we are passing a name of the file as a parameter in request and + gets undecoded into space on the server side. So the datanode receiving the streamFile request tries to access a file with space instead of + in the name and doesn't find that file.
> The proposed solution is to pass the filename as a part of URL as with all the other HFTP commands, since this is the only place where it is not being treated this way. Are there any objections to this?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.