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 1F353200CE0 for ; Fri, 25 Aug 2017 18:34:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 1C04116CD6F; Fri, 25 Aug 2017 16:34:10 +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 623B616CD6B for ; Fri, 25 Aug 2017 18:34:09 +0200 (CEST) Received: (qmail 2947 invoked by uid 500); 25 Aug 2017 16:34:08 -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 2936 invoked by uid 99); 25 Aug 2017 16:34:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Aug 2017 16:34:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id D398B1A239D for ; Fri, 25 Aug 2017 16:34:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-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 (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id E--pTEwZ23No for ; Fri, 25 Aug 2017 16:34:06 +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 1A8D760D26 for ; Fri, 25 Aug 2017 16:34:06 +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 CCC11E0D49 for ; Fri, 25 Aug 2017 16:34:03 +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 BEF2F25382 for ; Fri, 25 Aug 2017 16:34:01 +0000 (UTC) Date: Fri, 25 Aug 2017 16:34:01 +0000 (UTC) From: "Wellington Chevreuil (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (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 16:34:10 -0000 [ https://issues.apache.org/jira/browse/HDFS-12336?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Wellington Chevreuil updated HDFS-12336: ---------------------------------------- Attachment: HDFS-12336.003.patch Thanks for the suggestions [~xiaochen]! Indeed, checking the absolute path is much simpler. I thought of defining a new helper method, *isValidAbsolutePath* on *INode* class that does the check previously done on *checkAbsolutePath*, then using this new one on *EncryptionZoneManager.listEncryptionZones* to determine if the inode should be filtered or not. Also had applied the suggestions to *EncryptionZonesTest*, had added javadoc explaining why we need to move to Trash first, instead of simply deleting it, and also removed the calls to assertZonePresent. I also noticed latest patch was out of sync with trunk. I had rebased it to latest trunk version and had resolved some conflicts with HDFS-10899, which has doe a large refactoring in EncryptionZoneManager. These scenario was still failing, though. > 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, HDFS-12336.003.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