hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xiaoyu Yao (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-11102) Deleting .Trash without -skipTrash should be confirmed
Date Fri, 04 Nov 2016 07:19:58 GMT

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

Xiaoyu Yao commented on HDFS-11102:

Thanks [~cltlfcjin] for reporting the issue. Please check the -safely delete option added
by HADOOP-12358 to see if that helps your use cases.

> Deleting .Trash without -skipTrash should be confirmed
> ------------------------------------------------------
>                 Key: HDFS-11102
>                 URL: https://issues.apache.org/jira/browse/HDFS-11102
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: hdfs
>            Reporter: Lantao Jin
> As a Hadoop DEVOPS, I saw lots of cases that user delete their data by mistake.  Most
of them can be recovered from trash but the rest ones were not luck.
> A system can’t guess user's purpose,but a good system should help user to avoid their
> There is a very common case like:
> If a user want to delete some dir from HDFS, they may use:
> {code}
> hadoop -fs -rm -r /user/someone/pathToBeDelete
> {code}
> The directory /user/someone/pathToBeDelete will move into 
> {code}
> /user/someone/.Trash/current/user/someone/pathToBeDelete
> {code}
> If user want delete it permanently, option "-skipTrash" can be attached. That's the design
and Hadoop knows the user's purpose well.
> Usually, user didn't use "skipTrash" for safety consideration. That's good till now.
> But the purpose is to delete some data for saving more space. Then the user begin to
delete it from Trash with the below command:
> {code}
> hadoop -fs -rm -r /user/someone/ .Trash
> {code}
> Why not just delete "/user/someone/.Trash/current/user/someone/pathToBeDelete" is that
because the user knows only pathToBeDelete in trash directory now.
> The trash include pathToBeDelete will be deleted permanently.
> *But Wait! Do you see the blank space before the dot?*
> If you also type this command by "copy-paste" include some space or invisible char, the
whole /user/someone directory and the whole /user/someone/.Trash will be deleted unfortunately.
*Jesus, that's means the directory /user/someone is deleted permanently and unexpectedly!*
> So I think *any ".Trash" word appears in the "rm" command without "skip" should be launched
a double checking by system to help people to avoid their mistake.*
> If you also agree this design, I will offer a patch.

This message was sent by Atlassian JIRA

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

View raw message