[ 
https://issues.apache.org/jira/browse/HDFS-7728?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14542693#comment-14542693
 ] 

Haohui Mai commented on HDFS-7728:
----------------------------------

The patch looks good. 

{code}
+      // since we count everything of the subtree for the quota usage of a
+      // dst reference node, here we should just simply do a quota computation.
+      // then to avoid double counting, we pass a different QuotaDelta to other
+      // calls
+      final QuotaDelta old = reclaimContext.quotaDelta();
+      old.add(computeQuotaUsage(reclaimContext.bsps));
+      reclaimContext.setQuotaDelta(new QuotaDelta());
{code}

It might be easier to follow if creating a new {{ReclaimContext}}.

{code}
+    public void addUpdatePath(INode inode, QuotaCounts update) {
{code}

It might make sense to change the type of {{inode}} from {{INode}} to 
{{INodeReference}}.

{code}
-  @Test(timeout = 60000)
+  @Test//(timeout = 60000)
{code}

It looks unnecessary.

> Avoid updating quota usage while loading edits
> ----------------------------------------------
>
>                 Key: HDFS-7728
>                 URL: https://issues.apache.org/jira/browse/HDFS-7728
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Jing Zhao
>            Assignee: Jing Zhao
>              Labels: BB2015-05-RFC
>         Attachments: HDFS-7728.000.patch, HDFS-7728.001.patch, 
> HDFS-7728.002.patch
>
>
> Per the discussion 
> [here|https://issues.apache.org/jira/browse/HDFS-7611?focusedCommentId=14292454&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14292454],
>  currently we call {{INode#addSpaceConsumed}} while file/dir/snapshot 
> deletion, even if this is still in the edits loading process. This is 
> unnecessary and can cause issue like HDFS-7611. We should collect quota 
> change and call {{FSDirectory#updateCount}} at the end of the operation.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to