You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Xiao Kang (JIRA)" <ji...@apache.org> on 2010/06/07 09:37:55 UTC

[jira] Created: (HDFS-1189) Quota counts missed between clear quota and set quota

Quota counts missed between clear quota and set quota
-----------------------------------------------------

                 Key: HDFS-1189
                 URL: https://issues.apache.org/jira/browse/HDFS-1189
             Project: Hadoop HDFS
          Issue Type: Bug
          Components: name-node
    Affects Versions: 0.20.2, 0.22.0
            Reporter: Xiao Kang


HDFS Quota counts will be missed between a clear quota operation and a set quota.

When setting quota for a dir, the INodeDirectory will be replaced by INodeDirectoryWithQuota and dir.isQuotaSet() becomes true. When INodeDirectoryWithQuota  is newly created, quota counting will be performed. However, when clearing quota, the quota conf is set to -1 and dir.isQuotaSet() becomes false while INodeDirectoryWithQuota will NOT be replaced back to INodeDirectory.

FSDirectory.updateCount just update the quota count for inodes that isQuotaSet() is true. So after clear quota for a dir, its quota counts will not be updated and it's reasonable. But when re seting quota for this dir, quota counting will not be performed and some counts will be missed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HDFS-1189) Quota counts missed between clear quota and set quota

Posted by "Xiao Kang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HDFS-1189?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xiao Kang updated HDFS-1189:
----------------------------

    Attachment: HDFS-1189.patch

Patch attached.

Replace INodeDirectoryWithQuota back to INodeDirectory if isQuotaSet() is false after setQuota.

> Quota counts missed between clear quota and set quota
> -----------------------------------------------------
>
>                 Key: HDFS-1189
>                 URL: https://issues.apache.org/jira/browse/HDFS-1189
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: name-node
>    Affects Versions: 0.20.2, 0.22.0
>            Reporter: Xiao Kang
>         Attachments: HDFS-1189.patch
>
>
> HDFS Quota counts will be missed between a clear quota operation and a set quota.
> When setting quota for a dir, the INodeDirectory will be replaced by INodeDirectoryWithQuota and dir.isQuotaSet() becomes true. When INodeDirectoryWithQuota  is newly created, quota counting will be performed. However, when clearing quota, the quota conf is set to -1 and dir.isQuotaSet() becomes false while INodeDirectoryWithQuota will NOT be replaced back to INodeDirectory.
> FSDirectory.updateCount just update the quota count for inodes that isQuotaSet() is true. So after clear quota for a dir, its quota counts will not be updated and it's reasonable. But when re seting quota for this dir, quota counting will not be performed and some counts will be missed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HDFS-1189) Quota counts missed between clear quota and set quota

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-1189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12881927#action_12881927 ] 

Tsz Wo (Nicholas), SZE commented on HDFS-1189:
----------------------------------------------

Hi Xiao, thanks for reporting this and providing a patch.  Some comments on the patch:
- The following will get an array index exception when the inode is root.
{code}
+            INodeDirectory parent = (INodeDirectory)inodes[inodes.length-2];
{code}
- Need new unit tests.

> Quota counts missed between clear quota and set quota
> -----------------------------------------------------
>
>                 Key: HDFS-1189
>                 URL: https://issues.apache.org/jira/browse/HDFS-1189
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: name-node
>    Affects Versions: 0.20.2, 0.22.0
>            Reporter: Xiao Kang
>         Attachments: HDFS-1189.patch
>
>
> HDFS Quota counts will be missed between a clear quota operation and a set quota.
> When setting quota for a dir, the INodeDirectory will be replaced by INodeDirectoryWithQuota and dir.isQuotaSet() becomes true. When INodeDirectoryWithQuota  is newly created, quota counting will be performed. However, when clearing quota, the quota conf is set to -1 and dir.isQuotaSet() becomes false while INodeDirectoryWithQuota will NOT be replaced back to INodeDirectory.
> FSDirectory.updateCount just update the quota count for inodes that isQuotaSet() is true. So after clear quota for a dir, its quota counts will not be updated and it's reasonable. But when re seting quota for this dir, quota counting will not be performed and some counts will be missed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.