hadoop-hdfs-issues mailing list archives

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

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

Lantao Jin edited comment on HDFS-11102 at 11/4/16 6:45 AM:
------------------------------------------------------------

The simplest double check is displaying the file count and usage capacity of the deleting
directory, for the example mentioned above is:
{code}
Below directories will be deleted permanently:
/user/someone/.Trash with 172483232 files with 9.4PB

Are you sure to do that: [Y/N]
{code}
If user use the right command, it will display like:
{code}
Below directories will be deleted permanently:
/user/someone/.Trash with 423 files with 24MB

Are you sure to do that: [Y/N]
{code}

Or just forbid deleting multiple directories include trash:
{code}
Can not delete multiple directories include a trash! Command will not be executed.
{code}

Because that if users want to delete by one line command, they can use "skipTrash".


was (Author: cltlfcjin):
The simplest double check is displaying the file count and usage capacity of the deleting
directory, for the example mentioned above is:
{code}
Below directories will be deleted permanently:
/user/someone/.Trash with 172483232 files with 9.4PB

Are you sure to do that: [Y/N]
{code}
If user use the right command, it will display like:
{code}
Below directories will be deleted permanently:
/user/someone/.Trash with 423 files with 24MB

Are you sure to do that: [Y/N]
{code}

Or just forbid deleting multiple directories include trash:
{code}
Can not delete multiple directories include a trash! Command will not be executed.
{code}

All cases I mentioned are not related to skipTrash

> 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
mistakes.
> 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
(v6.3.4#6332)

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


Mime
View raw message