[ 
https://issues.apache.org/jira/browse/HDFS-1026?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tsz Wo Nicholas Sze updated HDFS-1026:
--------------------------------------
    Resolution: Not a Problem
        Status: Resolved  (was: Patch Available)

If the file is known to be small, it should use a small block size.

Resolving as not-a-problem. Please feel free to reopen if you disagree.

> Quota checks fail for small files and quotas
> --------------------------------------------
>
>                 Key: HDFS-1026
>                 URL: https://issues.apache.org/jira/browse/HDFS-1026
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: documentation, namenode
>    Affects Versions: 0.20.1, 0.20.2, 0.20.3, 0.21.0, 0.22.0
>            Reporter: Eli Collins
>              Labels: newbie
>         Attachments: HDFS-1026.pacth
>
>
> If a directory has a quota less than blockSize * numReplicas then you can't 
> add a file to it, even if the file size is less than the quota. This is 
> because FSDirectory#addBlock updates the count assuming at least one block is 
> written in full. We don't know how much of the block will be written when 
> addBlock is called and supporting such small quotas is not important so 
> perhaps we should document this and log an error message instead of making 
> small (blockSize * numReplicas) quotas work.
> {code}
> // check quota limits and updated space consumed
> updateCount(inodes, inodes.length-1, 0, 
> fileINode.getPreferredBlockSize()*fileINode.getReplication(), true);
> {code}
> You can reproduce with the following commands:
> {code}
> $ dd if=/dev/zero of=temp bs=1000 count=64
> $ hadoop fs -mkdir /user/eli/dir
> $ hdfs dfsadmin -setSpaceQuota 191M /user/eli/dir
> $ hadoop fs -put temp /user/eli/dir  # Causes DSQuotaExceededException
> {code}



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

Reply via email to