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 42CB4200CFE for ; Fri, 25 Aug 2017 08:10:08 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4134216C29D; Fri, 25 Aug 2017 06:10:08 +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 874E516C29C for ; Fri, 25 Aug 2017 08:10:07 +0200 (CEST) Received: (qmail 7154 invoked by uid 500); 25 Aug 2017 06:10:06 -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 7143 invoked by uid 99); 25 Aug 2017 06:10:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Aug 2017 06:10:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 047B11806DF for ; Fri, 25 Aug 2017 06:10:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, 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 (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id EpAZVzkZ4sHi for ; Fri, 25 Aug 2017 06:10:04 +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 047C25FE64 for ; Fri, 25 Aug 2017 06:10:04 +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 A1FCBE0373 for ; Fri, 25 Aug 2017 06:10:02 +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 63CFC2537F for ; Fri, 25 Aug 2017 06:10:01 +0000 (UTC) Date: Fri, 25 Aug 2017 06:10:01 +0000 (UTC) From: "Xiao Chen (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-12336) Listing encryption zones still fails when deleted EZ is not a direct child of snapshottable directory MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 25 Aug 2017 06:10:08 -0000 [ https://issues.apache.org/jira/browse/HDFS-12336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16141247#comment-16141247 ] Xiao Chen commented on HDFS-12336: ---------------------------------- Thanks for revving and providing more details Wellington! It all makes sense to me, a few comments: - for the {{isValidEZPath}} check, can we check {{pathName}} for absolute path, instead of walking through the inode all the way to the root? INode.java currently has {{checkAbsolutePath}} which is exactly where the exception is thrown now. Perhaps we can extract the if condition to a helper method, and reuse it in our {{isValidEZPath}} check? - Suggest to use javadoc on the {{isValidEZPath}} method comment. Replacing the '/*' with '/**' should do. - The added test looks good. I think we should call out why move to trash then delete is necessary (instead of fsWrapper.delete): to create a inodereference for the test. - Instead of 2 {{assertZonePresent}}, it feels to me we could list the zones once, then check things while going through the iterator. - Similarly for the last assert, maybe we can verify from listing directly, rather than the current way of catching assertion error on a method named {{assertZonePresent}} and assert the message. :) > Listing encryption zones still fails when deleted EZ is not a direct child of snapshottable directory > ----------------------------------------------------------------------------------------------------- > > Key: HDFS-12336 > URL: https://issues.apache.org/jira/browse/HDFS-12336 > Project: Hadoop HDFS > Issue Type: Bug > Components: hdfs > Affects Versions: 3.0.0-alpha4 > Reporter: Wellington Chevreuil > Assignee: Wellington Chevreuil > Priority: Minor > Attachments: HDFS-12336.001.patch, HDFS-12336.002.patch > > > The fix proposed on HDFS-11197 didn't cover the scenario where the EZ deleted but still under a snapshot is not a direct child of the snapshottable directory. > Here the code snippet proposed on HDFS-11197 that would avoid the error reported by *hdfs crypto -listZones* when a deleted EZ is still under a given snapshot: > {noformat} > INode lastINode = null; > if (inode.getParent() != null || inode.isRoot()) { > INodesInPath iip = dir.getINodesInPath(pathName, DirOp.READ_LINK); > lastINode = iip.getLastINode(); > } > if (lastINode == null || lastINode.getId() != ezi.getINodeId()) { > continue; > } > {noformat} > It will ignore EZs when it's a direct child of a snapshot, because its parent inode will be null, and it isn't the root inode. However, if the EZ is not directly under snapshottable directory, its parent will not be null, and it will pass this check, so it will fail further due *absolute path required* validation error. > I would like to work on a fix that would also cover this scenario. -- 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