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 A46C2200B8D for ; Fri, 9 Sep 2016 03:02:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A325E160AAD; Fri, 9 Sep 2016 01:02:22 +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 E7237160AD0 for ; Fri, 9 Sep 2016 03:02:21 +0200 (CEST) Received: (qmail 49092 invoked by uid 500); 9 Sep 2016 01:02:21 -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 49065 invoked by uid 99); 9 Sep 2016 01:02:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Sep 2016 01:02:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id A2F212C1B7F for ; Fri, 9 Sep 2016 01:02:20 +0000 (UTC) Date: Fri, 9 Sep 2016 01:02:20 +0000 (UTC) From: "Konstantin Shvachko (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-10843) Quota Feature Cached Size != Computed Size When Block Committed But Not Completed MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 09 Sep 2016 01:02:22 -0000 [ https://issues.apache.org/jira/browse/HDFS-10843?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15475512#comment-15475512 ] Konstantin Shvachko commented on HDFS-10843: -------------------------------------------- Hey Erik, looks like you are fixing two issues here. One about updating space cache value after completing the block, and another that {{setReplication()}} incorrectly updates space for UC files. Both good finds, great! # Your idea to place space update logic in a single place, inside {{completeBlock()}}, is good. I would suggest implementing it a bit differently. I would move the part of {{FSN.commitOrCompleteLastBlock()}} related to {{// Adjust disk space consumption if required}} to {{FSDirectory}} as a new method {{adjustSpaceConsumed(fileINode, iip, commitBlock)}}. Then you can call it from {{completeBlock()}}, which should take {{FSDirectory}} as a parameter. Better not to change {{Namespace}} interface. # The tests looks good. I see you shutting down 3 DNs in the new test. Which may affect old tests if they are executed after the new ones. I did not check but worth verifying. # Also {{Answer}} should be used with a generic parameter {{Answer}}. > Quota Feature Cached Size != Computed Size When Block Committed But Not Completed > --------------------------------------------------------------------------------- > > Key: HDFS-10843 > URL: https://issues.apache.org/jira/browse/HDFS-10843 > Project: Hadoop HDFS > Issue Type: Bug > Components: hdfs, namenode > Affects Versions: 2.6.0 > Reporter: Erik Krogen > Assignee: Erik Krogen > Attachments: HDFS-10843.000.patch, HDFS-10843.001.patch > > > Currently when a block has been committed but has not yet been completed, the cached size (used for the quota feature) of the directory containing that block differs from the computed size. This results in log messages of the following form: > bq. ERROR namenode.NameNode (DirectoryWithQuotaFeature.java:checkStoragespace(141)) - BUG: Inconsistent storagespace for directory /TestQuotaUpdate. Cached = 512 != Computed = 8192 > When a block is initially started under construction, the used space is conservatively set to a full block. When the block is committed, the cached size is updated to the final size of the block. However, the calculation of the computed size uses the full block size until the block is completed, so in the period where the block is committed but not completed they disagree. To fix this we need to decide which is correct and fix the other to match. It seems to me that the cached size is correct since once the block is committed its size will not change. > This can be reproduced using the following steps: > - Create a directory with a quota > - Start writing to a file within this directory > - Prevent all datanodes to which the file is written from communicating the corresponding BlockReceivedAndDeletedRequestProto to the NN temporarily (i.e. simulate a transient network partition/delay) > - During this time, call DistributedFileSystem.getContentSummary() on the directory with the quota -- 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