[
https://issues.apache.org/jira/browse/HDFS-14200?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16740844#comment-16740844
]
Stephen O'Donnell commented on HDFS-14200:
------------------------------------------
> I recently found out it does not work if encryption (EZ) is enabled
The expunge command gives an error if there are EZs, but it still expunges the
trash in your home directory. I can have a look and see if there is any easy
way to fix this with an emptyTrash command. The problem, is that it requires
admin rights to list all the EZs in the cluster, and the user could have a
trash folder in any of them. At first glance its hard to see a way around this
as the starting point has to be getting that list of EZs.
As a slight aside, I have thought it would be useful to allow an admin user to
be able to empty the trash for another user by passing the user id. It would
probably be best to do that in a followup Jira if we get this one resolved.
> To play it safe we may want to add options to confirm or to list what is
> being deleted?
Do we have confirmations in any other shell commands? One of the most
dangerous, -skipTrash, does not and I cannot think of any others that do.
I would be open to adding a confirmation message, perhaps with a force switch
to allow scripts to use it easily, but I'd like it to be consistent with
existing patterns too.
Could it be argued that the trash is the safety net, so a confirmation to empty
the trash is not really necessary?
> Add emptyTrash option to purge trash immediately
> ------------------------------------------------
>
> Key: HDFS-14200
> URL: https://issues.apache.org/jira/browse/HDFS-14200
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: namenode
> Reporter: Stephen O'Donnell
> Assignee: Stephen O'Donnell
> Priority: Major
> Attachments: HDFS-14200.001.patch
>
>
> I have always felt the HDFS trash is missing a simple way to empty the
> current users trash immediately. We have "expunge" but in my experience
> supporting clusters, end users find this confusing. When most end users run
> expunge, they really want to empty their trash immediately and get confused
> when expunge does not do this.
> This can result in users performing somewhat dangerous "skipTrash" operations
> on the trash to free up space. The alternative, which most users will not
> figure out on their own is:
> # Run the expunge command once - this will move the current folder to a
> checkpoint and remove any old checkpoints older than the retention interval
> # Wait over 1 minute and then run expunge again, overriding fs.trash.interval
> to 1 minute using the following command hadoop fs -Dfs.trash.interval=1
> -expunge.
> With this Jira I am proposing to add a extra command, "hdfs dfs -emptyTrash"
> that purges everything in the logged in users Trash directories immediately.
> How would the community feel about adding this new option? I will upload a
> patch for comments.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]