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

Xiaoyu Yao commented on HDFS-8476:
----------------------------------

[~tongshiquan], thanks for reporting the issue. I tried the scenario with a 
single node cluster with a 150MB file and slightly smaller quota size 400MB but 
cannot repro it. 

{code}
$ hdfs dfs -mkdir /HOT
$ hdfs dfs -put hadoop-3.0.0-SNAPSHOT.tar.gz /HOT/FILE1
$ hdfs dfsadmin -setSpaceQuota 400M -storageType DISK /HOT
$ hdfs storagepolicies -setStoragePolicy -path /HOT -policy HOT
Set storage policy HOT on /HOT
$ hdfs dfs -count -q -h -v -t DISK /HOT
   DISK_QUOTA    REM_DISK_QUOTA PATHNAME
        400 M           256.6 M /HOT
$ hdfs dfs -put hadoop-3.0.0-SNAPSHOT.tar.gz /HOT/FILE2
$ hdfs dfs -count -q -h -v -t DISK /HOT
   DISK_QUOTA    REM_DISK_QUOTA PATHNAME
        400 M           113.3 M /HOT
$ hdfs dfs -put hadoop-3.0.0-SNAPSHOT.tar.gz /HOT/FILE3
put: Quota by storage type : DISK on path : /HOT is exceeded. quota = 400 MB 
but space consumed = 414.71 MB
{code}

> quota can't limit the file which put before setting the storage policy
> ----------------------------------------------------------------------
>
>                 Key: HDFS-8476
>                 URL: https://issues.apache.org/jira/browse/HDFS-8476
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: HDFS
>    Affects Versions: 2.7.0
>            Reporter: tongshiquan
>            Assignee: kanaka kumar avvaru
>            Priority: Minor
>              Labels: QBST
>
> test steps:
> 1. hdfs dfs -mkdir /HOT
> 2. hdfs dfs -put 1G.txt /HOT/file1
> 3. hdfs dfsadmin -setSpaceQuota 6442450944 -storageType DISK /HOT
> 4. hdfs storagepolicies -setStoragePolicy -path /HOT -policy HOT
> 5. hdfs dfs -put 1G.txt /HOT/file2
> 6. hdfs dfs -put 1G.txt /HOT/file3
> 7. hdfs dfs -count -q -h -v -t DISK /HOT
> In step6 file put should fail, because /HOT/file1 and /HOT/file2 have reach 
> the directory /HOT space quota 6GB (1G*3 replicas + 1G*3 replicas), but here 
> it success, and in step7 count shows remaining quota is -3GB
> FYI, if change the turn of step3 and step4, then it turns out normal



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

Reply via email to