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

Stephen O'Donnell commented on HADOOP-17639:
--------------------------------------------

I agree with Steve here. We have seen many people burned by accidentally 
deleting things with -skipTrash, but as soon as you make it prompt to confirm, 
you break compatibility, and you need to give a "force" option to let scripts 
work correctly, and people will just start using that.

Linux doesn't protect you from a "rm -rf", so we are slight better than that. 
HDFS also has protected directories to prevent non-empty directory trees from 
getting deleted, so ideally use that feature to protect the major high level 
folders on your cluster.

There are circumstances where skipTrash is needed due to quotas, or a cluster 
that needs spaced freed up quickly.

Perhaps one middle ground, would be a client config setting that says "the skip 
trash flag is ignored" and then if you pass it on the CLI, it just behaves as 
if you did not pass it. This would be a client side config, so a user could 
override, it, but they would need to go more out of their way by running a 
command like:

{code}
hadoop fs -Ddfs.client.allow.skipTrash=true -rm -skipTrash /some/folder
{code}

The setting would be true by default to maintain current behaviour.

I sill wouldn't rule out someone making an alias for that command and 
accidentally deleting something they should not even with this :-)

> Restrict the "-skipTrash" param for accidentally deletes data
> -------------------------------------------------------------
>
>                 Key: HADOOP-17639
>                 URL: https://issues.apache.org/jira/browse/HADOOP-17639
>             Project: Hadoop Common
>          Issue Type: Improvement
>            Reporter: Bhavik Patel
>            Priority: Major
>
> Suppose the user tries to delete the data from CLI with the "-skipTrash" 
> param but by mistake, he deleted a couple of directories but actually, that 
> directory user want to retain then their is no way to retrieve the delete 
> data.
> It will be good to have a confirm message like: "Skip the trash for the 
> hdfs:///dri1/file.txt files? (Y or N)" ro we can completely disable the 
> "-skipTrash" param.
>  



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to