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

Daryn Sharp commented on HADOOP-7771:
-------------------------------------

John's patch introduces at least these bugs:
# Copy multiple args to a non-existent destination is supposed to fail.  The 
patch auto-creates the destination as a directory, thus shorting out the check 
in the parent class.  Ex. "fs -cp f1 f2 f3 dir" should fail if dir doesn't 
exist, the patch changed it to succeed.
# If the source is a directory, and the destination doesn't exist, then the 
source is effectively supposed to be renamed as the destination.  The 
auto-creates the destination as a directory and copies the source into the 
destination.  Ex. "fs -get dir does-not-exist" should create "does-not-exist" 
with the contents of "dir".  This patch creates "does-not-exist/dir".
# If a directory is copied to a file, the exception thrown is not using the 
PathData string.

In effect, we are adding bugs, and trading a NPE with copying to the wrong 
destination, so it's a wash as far as testing is concerned.

FWIW, early this year, I ported all this copy/move code as part of the FsShell 
redesign.  I realized I introduced bugs way back in June or July and prepared a 
patch.  I thought I lost the patch, so John started working this jira, but I 
dug it up the patch this weekend.  I stripped out all the extra functionality 
that was added in that patch and posted the result.
                
> NPE when running hdfs dfs -copyToLocal, -get etc
> ------------------------------------------------
>
>                 Key: HADOOP-7771
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7771
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.23.0, 0.24.0
>            Reporter: John George
>            Assignee: Daryn Sharp
>            Priority: Blocker
>         Attachments: HADOOP-7771.patch, HADOOP-7771.patch, HADOOP-7771.patch, 
> HADOOP-7771.patch, HADOOP-7771.patch, HADOOP-7771.patch
>
>
> NPE when running hdfs dfs -copyToLocal if the destination directory does not 
> exist. The behavior in branch-0.20-security is to create the directory and 
> copy/get the contents from source.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to