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 26350200D21 for ; Mon, 16 Oct 2017 21:59:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 24D631609E3; Mon, 16 Oct 2017 19:59:05 +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 69C39160BE9 for ; Mon, 16 Oct 2017 21:59:04 +0200 (CEST) Received: (qmail 30306 invoked by uid 500); 16 Oct 2017 19:59:03 -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 30212 invoked by uid 99); 16 Oct 2017 19:59:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Oct 2017 19:59:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 895EECC0A6 for ; Mon, 16 Oct 2017 19:59:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id VXs23_DZ2kZD for ; Mon, 16 Oct 2017 19:59:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 57F905FAC9 for ; Mon, 16 Oct 2017 19:59:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 9E4ABE0E91 for ; Mon, 16 Oct 2017 19:59:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 539882438C for ; Mon, 16 Oct 2017 19:59:00 +0000 (UTC) Date: Mon, 16 Oct 2017 19:59:00 +0000 (UTC) From: "Wei-Chiu Chuang (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HDFS-12485) expunge may fail to remove trash from encryption zone MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 16 Oct 2017 19:59:05 -0000 [ https://issues.apache.org/jira/browse/HDFS-12485?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Wei-Chiu Chuang updated HDFS-12485: ----------------------------------- Summary: expunge may fail to remove trash from encryption zone (was: expunge may not remove trash from encryption zone) > expunge may fail to remove trash from encryption zone > ----------------------------------------------------- > > Key: HDFS-12485 > URL: https://issues.apache.org/jira/browse/HDFS-12485 > Project: Hadoop HDFS > Issue Type: Bug > Affects Versions: 2.8.0, 3.0.0-alpha1 > Reporter: Wei-Chiu Chuang > Assignee: Wei-Chiu Chuang > Attachments: HDFS-12485.001.patch > > > This is related to HDFS-12484, but turns out that even if I have super user permission, -expunge may not remove trash either. > If I log into Linux as root, and then login as the superuser hdfs@EXAMPLE.COM > {noformat} > [root@nightly511-1 ~]# hdfs dfs -rm /scale/b > 17/09/18 15:21:32 INFO fs.TrashPolicyDefault: Moved: 'hdfs://ns1/scale/b' to trash at: hdfs://ns1/scale/.Trash/hdfs/Current/scale/b > [root@nightly511-1 ~]# hdfs dfs -expunge > 17/09/18 15:21:59 INFO fs.TrashPolicyDefault: TrashPolicyDefault#deleteCheckpoint for trashRoot: hdfs://ns1/user/hdfs/.Trash > 17/09/18 15:21:59 INFO fs.TrashPolicyDefault: TrashPolicyDefault#deleteCheckpoint for trashRoot: hdfs://ns1/user/hdfs/.Trash > 17/09/18 15:21:59 INFO fs.TrashPolicyDefault: Deleted trash checkpoint: /user/hdfs/.Trash/170918143916 > 17/09/18 15:21:59 INFO fs.TrashPolicyDefault: TrashPolicyDefault#createCheckpoint for trashRoot: hdfs://ns1/user/hdfs/.Trash > [root@nightly511-1 ~]# hdfs dfs -ls hdfs://ns1/scale/.Trash/hdfs/Current/scale/b > -rw-r--r-- 3 hdfs systest 0 2017-09-18 15:21 hdfs://ns1/scale/.Trash/hdfs/Current/scale/b > {noformat} > expunge does not remove trash under /scale, because it does not know I am 'hdfs' user. > {code:title=DistributedFileSystem#getTrashRoots} > Path ezTrashRoot = new Path(it.next().getPath(), > FileSystem.TRASH_PREFIX); > if (!exists(ezTrashRoot)) { > continue; > } > if (allUsers) { > for (FileStatus candidate : listStatus(ezTrashRoot)) { > if (exists(candidate.getPath())) { > ret.add(candidate); > } > } > } else { > Path userTrash = new Path(ezTrashRoot, System.getProperty( > "user.name")); --> bug > try { > ret.add(getFileStatus(userTrash)); > } catch (FileNotFoundException ignored) { > } > } > {code} > It should use UGI for user name, rather than system login user name. -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org