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

Wei Yan commented on HDFS-13045:
--------------------------------

I cannot produce the error pattern I mentioned above through some fs 
operations. Not sure whether it is still valid. The following code is just a 
quick test against this error pattern.
{code:java}
String msg = "Parent directory doesn't exist: /a/a/b";
String src = "/ns1/a";
String dst = "/a";
String newMsg = msg.replaceAll(dst, src);
int minLen = Math.min(dst.length(), src.length());
for (int i = 0; newMsg.equals(msg) && i < minLen; i++) {
  // Check if we can replace sub folders
  String dst1 = dst.substring(0, dst.length() - 1 - i);
  String src1 = src.substring(0, src.length() - 1 - i);
  newMsg = msg.replaceAll(dst1, src1);
}
System.out.println(newMsg);{code}
I think currently the patch cannot handle it, as it replaceAll at the first 
place.

One more nit thing is, we may also need to set the stackTrace back when 
generating the new exception.

> RBF: Improve error message returned from subcluster
> ---------------------------------------------------
>
>                 Key: HDFS-13045
>                 URL: https://issues.apache.org/jira/browse/HDFS-13045
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Wei Yan
>            Assignee: Wei Yan
>            Priority: Minor
>         Attachments: HDFS-13045.000.patch, HDFS-13045.001.patch, 
> HDFS-13045.002.patch
>
>
> Currently, Router directly returns exception response from subcluster to 
> client, which may not have the correct error message, especially when the 
> error message containing a path.
> One example, we have a mount path "/a/b" mapped to subclusterA's "/c/d". If 
> user1 does a chown operation on "/a/b", and he doesn't have corresponding 
> privilege, currently the error msg looks like "Permission denied. user=user1 
> is not the owner of inode=/c/d", which may confuse user. Would be better to 
> reverse the path back to original mount path.
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to