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 1A4CC200CD3 for ; Fri, 14 Jul 2017 00:33:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 0EE5616D04E; Thu, 13 Jul 2017 22:33: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 54E8616D04A for ; Fri, 14 Jul 2017 00:33:04 +0200 (CEST) Received: (qmail 84135 invoked by uid 500); 13 Jul 2017 22:33: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 84124 invoked by uid 99); 13 Jul 2017 22:33:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Jul 2017 22:33:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id BB4B1C090E for ; Thu, 13 Jul 2017 22:33:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-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 (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 3KcCiEVzuipl for ; Thu, 13 Jul 2017 22:33:02 +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 6970F5FBBD for ; Thu, 13 Jul 2017 22:33: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 B33F8E0D45 for ; Thu, 13 Jul 2017 22:33: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 130C024756 for ; Thu, 13 Jul 2017 22:33:00 +0000 (UTC) Date: Thu, 13 Jul 2017 22:33:00 +0000 (UTC) From: "Chen Liang (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HDFS-12130) Optimizing permission check for getContentSummary MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 13 Jul 2017 22:33:05 -0000 [ https://issues.apache.org/jira/browse/HDFS-12130?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Chen Liang updated HDFS-12130: ------------------------------ Attachment: HDFS-12130.003.patch Post v003 patch. Thanks [~szetszwo] for the review and the offline discussions!! > Optimizing permission check for getContentSummary > ------------------------------------------------- > > Key: HDFS-12130 > URL: https://issues.apache.org/jira/browse/HDFS-12130 > Project: Hadoop HDFS > Issue Type: Improvement > Components: namenode > Reporter: Chen Liang > Assignee: Chen Liang > Attachments: HDFS-12130.001.patch, HDFS-12130.002.patch, HDFS-12130.003.patch > > > Currently, {{getContentSummary}} takes two phases to complete: > - phase1. check the permission of the entire subtree. If any subdirectory does not have {{READ_EXECUTE}}, an access control exception is thrown and {{getContentSummary}} terminates here (unless it's super user). > - phase2. If phase1 passed, it will then traverse the entire tree recursively to get the actual content summary. > An issue is, both phases currently hold the fs lock. > Phase 2 has already been written that, it will yield the fs lock over time, such that it does not block other operations for too long. However phase 1 does not yield. Meaning it's possible that the permission check phase still blocks things for long time. > One fix is to add lock yield to phase 1. But a simpler fix is to merge phase 1 into phase 2. Namely, instead of doing a full traversal for permission check first, we start with phase 2 directly, but for each directory, before obtaining its summary, check its permission first. This way we take advantage of existing lock yield in phase 2 code and still able to check permission and terminate on access exception. > Thanks [~szetszwo] for the offline discussions! -- 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