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 9764F200AC8 for ; Tue, 24 May 2016 03:44:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 961FC160A2F; Tue, 24 May 2016 01:44:14 +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 E500F160A0E for ; Tue, 24 May 2016 03:44:13 +0200 (CEST) Received: (qmail 14538 invoked by uid 500); 24 May 2016 01:44:13 -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 14502 invoked by uid 99); 24 May 2016 01:44:12 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 May 2016 01:44:12 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id D61EA2C1F5C for ; Tue, 24 May 2016 01:44:12 +0000 (UTC) Date: Tue, 24 May 2016 01:44:12 +0000 (UTC) From: "Yiqun Lin (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-10448) CacheManager#checkLimit always assumes a replication factor of 1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 24 May 2016 01:44:14 -0000 [ https://issues.apache.org/jira/browse/HDFS-10448?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15297506#comment-15297506 ] Yiqun Lin commented on HDFS-10448: ---------------------------------- So, [~cmccabe], what do you think the patch for this? > CacheManager#checkLimit always assumes a replication factor of 1 > ----------------------------------------------------------------- > > Key: HDFS-10448 > URL: https://issues.apache.org/jira/browse/HDFS-10448 > Project: Hadoop HDFS > Issue Type: Bug > Components: caching > Affects Versions: 2.7.1 > Reporter: Yiqun Lin > Assignee: Yiqun Lin > Attachments: HDFS-10448.001.patch > > > The logic in {{CacheManager#checkLimit}} is not correct. In this method, it does with these three logic: > First, it will compute needed bytes for the specific path. > {code} > CacheDirectiveStats stats = computeNeeded(path, replication); > {code} > But the param {{replication}} is not used here. And the bytesNeeded is just one replication's vaue. > {code} > return new CacheDirectiveStats.Builder() > .setBytesNeeded(requestedBytes) > .setFilesCached(requestedFiles) > .build(); > {code} > Second, then it should be multiply by the replication to compare the limit size because the method {{computeNeeded}} was not used replication. > {code} > pool.getBytesNeeded() + (stats.getBytesNeeded() * replication) > pool.getLimit() > {code} > Third, if we find the size was more than the limit value and then print warning info. It divided by replication here, while the {{stats.getBytesNeeded()}} was just one replication value. > {code} > throw new InvalidRequestException("Caching path " + path + " of size " > + stats.getBytesNeeded() / replication + " bytes at replication " > + replication + " would exceed pool " + pool.getPoolName() > + "'s remaining capacity of " > + (pool.getLimit() - pool.getBytesNeeded()) + " bytes."); > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org