[
https://issues.apache.org/jira/browse/HADOOP-7478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13070919#comment-13070919
]
XieXianshan commented on HADOOP-7478:
-------------------------------------
Thanks a lot for your comments,@Daryn & @Eli & @Todd.
To Daryn:
Reproduction steps:
1)start DFS.
2)kill all the datanodes.
3)put files into DFS.
# ls /work/xg1
-rw-r--r-- 1 root root 363 Jul 19 15:49 /work/xg1
# hadoop dfs -put /work/xg1 /user/hadoop/
4)# hadoop dfs -ls /user/hadoop
Found 2 items
-rw-r--r-- 1 root supergroup 32 2011-07-26 10:05
/user/hadoop/xg
-rw-r--r-- 1 root supergroup 0 2011-07-26 10:05
/user/hadoop/xg1
To Todd:
Thanks for your suggestion,but i think the problem will still exists while
there`s an exception during putting file to the .tmp file.
To Eli:
Before copying bytes really,the function checkDest() will check the problems
such as "target already exists" and "target is a dir". And i think it is
necessary to delete the dest file while there`s an error reading the
src,because it is easy to mislead users if 0-byte file retained.
> 0-byte files retained in the dfs while the FSshell -put is unsuccessful
> -----------------------------------------------------------------------
>
> Key: HADOOP-7478
> URL: https://issues.apache.org/jira/browse/HADOOP-7478
> Project: Hadoop Common
> Issue Type: Bug
> Components: fs
> Affects Versions: 0.23.0
> Reporter: XieXianshan
> Assignee: XieXianshan
> Priority: Trivial
> Attachments: HADOOP-7478.patch
>
>
> The process of putting file into dfs is approximately as follows:
> 1) create a file in the dfs
> 2) copy from one stream to the file
> But the problem is that the file is still retained in the dfs when the
> process 2) is terminated abnormally with unexpected exceptions,such as there
> is no DataNode alive.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira