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

zhengchenyu commented on MAPREDUCE-7287:
----------------------------------------

[~ste...@apache.org] 

I Found the problem is computeSourceRootPath. When list source, distCpContext's 
src is real srcPath ,distCpContext's target is real targetPath. But when 
listTargetFiles, target is a not exists file. So computeSourceRootPath result 
diffrent file, in my case computeSourceRootPath return '/tmp/a' when list 
source, but return '/tmp' when list target. It result to diffrent filename in 
sequence file.

And I think when construct DistCpOptions for listTargetFiles, we should set 
targetPath to targetFinalPath, but not resultNonePath. Here I sumit 
MAPREDUCE-7287.001.patch. Please help me review, thanks. 

> Distcp will delete exists file ,  If we use "--delete and --update" options 
> and distcp file.
> --------------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-7287
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-7287
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>          Components: distcp
>    Affects Versions: 3.2.1
>            Reporter: zhengchenyu
>            Priority: Major
>             Fix For: 3.3.1
>
>         Attachments: MAPREDUCE-7287.001.patch
>
>
> hdfs://ns1/tmp/a is an existing file, hdfs://ns2/tmp/a is also an existing 
> file.
> When I run this command, 
> {code:java}
> hadoop distcp -delete -update hdfs://ns1/tmp/a hdfs://ns2/tmp/a
> {code}
> I Found hdfs://ns2/tmp/a is deleted unpectectedly.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to