Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B47AF200BB6 for ; Fri, 4 Nov 2016 09:26:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id B34A4160AE8; Fri, 4 Nov 2016 08:26:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 059C0160B04 for ; Fri, 4 Nov 2016 09:25:59 +0100 (CET) Received: (qmail 1018 invoked by uid 500); 4 Nov 2016 08:25:58 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 665 invoked by uid 99); 4 Nov 2016 08:25:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Nov 2016 08:25:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id B78AF2C2AB7 for ; Fri, 4 Nov 2016 08:25:58 +0000 (UTC) Date: Fri, 4 Nov 2016 08:25:58 +0000 (UTC) From: "Yuanbo Liu (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-11102) Deleting .Trash without -skipTrash should be confirmed MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 04 Nov 2016 08:26:00 -0000 [ https://issues.apache.org/jira/browse/HDFS-11102?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1563= 5649#comment-15635649 ]=20 Yuanbo Liu commented on HDFS-11102: ----------------------------------- Prompting up info before deleting could be annoying and incompatible. I'd prefer implementing a command like "hadoop fs -clearTrash" to clear tra= sh safely. > 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 mi= stake. Most of them can be recovered from trash but the rest ones were not= luck. > A system can=E2=80=99t guess user's purpose=EF=BC=8Cbut a good system sho= uld 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=20 > {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 goo= d till now. > But the purpose is to delete some data for saving more space. Then the us= er 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/pathToBeDe= lete" 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 invis= ible char, the whole /user/someone directory and the whole /user/someone/.T= rash will be deleted unfortunately. *Jesus, that's means the directory /use= r/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 thei= r 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