Return-Path: X-Original-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DBDEDDD94 for ; Mon, 13 Aug 2012 20:06:40 +0000 (UTC) Received: (qmail 98229 invoked by uid 500); 13 Aug 2012 20:06:38 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 98172 invoked by uid 500); 13 Aug 2012 20:06:38 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 97822 invoked by uid 99); 13 Aug 2012 20:06:38 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Aug 2012 20:06:38 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 2C14E2C5AD5 for ; Mon, 13 Aug 2012 20:06:38 +0000 (UTC) Date: Tue, 14 Aug 2012 07:06:38 +1100 (NCT) From: "Eli Collins (JIRA)" To: common-issues@hadoop.apache.org Message-ID: <785202062.3614.1344888398181.JavaMail.jiratomcat@arcas> Subject: [jira] [Created] (HADOOP-8690) Shell may remove a file without going to trash even if skipTrash is not enabled MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Eli Collins created HADOOP-8690: ----------------------------------- Summary: Shell may remove a file without going to trash even if skipTrash is not enabled Key: HADOOP-8690 URL: https://issues.apache.org/jira/browse/HADOOP-8690 Project: Hadoop Common Issue Type: Bug Affects Versions: 2.0.0-alpha Reporter: Eli Collins Priority: Minor Delete.java contains the following comment: {noformat} // TODO: if the user wants the trash to be used but there is any // problem (ie. creating the trash dir, moving the item to be deleted, // etc), then the path will just be deleted because moveToTrash returns // false and it falls thru to fs.delete. this doesn't seem right {noformat} If Trash#moveToAppropriateTrash returns false FsShell will delete the path even if skipTrash is not enabled. The comment isn't quite right as some of these failure scenarios result in exceptions not a false return value, and in the case of an exception we don't unconditionally delete the path. TrashPolicy#moveToTrash states that it only returns false if the item is already in the trash or trash is disabled, and the expected behavior for these cases is to just delete the path. However TrashPolicyDefault#moveToTrash also returns false if there's a problem creating the trash directory, so for this case I don't think we should throw an exception rather than return false. I also question the behavior of just deleting when the item is already in the trash as it may have changed since previously put in the trash and not been checkpointed yet. Seems like in this case we should move it to trash but with a file name suffix. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira