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

Arpit Agarwal commented on HDFS-7723:
-------------------------------------

While reviewing the tests I realized I have one question about snapshots. If we 
have the following sequence:
# Create directory and set per-type quotas.
# Create file with storage policy to consume per type quotas.
# Snapshot the dir, then delete the file.

Since the file no longer exists outside the snapshot and we compute quota usage 
based on intention, what is the intended per-type quota usage of the directory? 
My guess is only the legacy space quota should be used. Could you please 
confirm?


We need more tests:
# Related to the above sequence, storage type quota code paths in 
updateQuotaAndCollectBlocks are not exercised with the added tests.
# Verify type quota persistence in edit logs
# Verify Persistence in fs image.
# Test with both traditional and type quotas set and one of the two is 
violated. We should get exceptions in either case.

We can add them separately. So two follow up Jiras - one for 
refactoring/renaming and one for tests.

Nitpicks on TestQuotaByStorageType.java:
# Line 104 comment - ONESSD -> storagePolicy
# testQuotaByStorageTypeParentOffChildOn - the comment and test don't agree. 
The comment says _Since both child directory have SSD quota set, expect an 
exception when creating files under either child or parent._. The test is not 
setting any quota on the parent.
# testQuotaByStorageTypeParentOnChildOn - also comment on line 425 looks wrong. 
_2 * BLOCKSIZE_ will succeed.


The patch looks great otherwise. I'd be +1 on committing with above points 
clarified and follow up Jiras filed.

> Quota By Storage Type namenode implemenation
> --------------------------------------------
>
>                 Key: HDFS-7723
>                 URL: https://issues.apache.org/jira/browse/HDFS-7723
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: datanode, namenode
>            Reporter: Xiaoyu Yao
>            Assignee: Xiaoyu Yao
>         Attachments: HDFS-7723.0.patch, HDFS-7723.1.patch, HDFS-7723.2.patch, 
> HDFS-7723.3.patch, HDFS-7723.4.patch
>
>
> This includes: 1) new editlog to persist quota by storage type op 2) 
> corresponding fsimage load/save the new op. 3) QuotaCount refactor to update 
> usage of the storage types for quota enforcement 4) Snapshot support 5) Unit 
> test update



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

Reply via email to