[Gluster-devel] Quota problems with dispersed volumes

Xavier Hernandez xhernandez at datalab.es
Tue Oct 28 13:05:29 UTC 2014


On 10/28/2014 04:30 AM, Raghavendra Gowdappa wrote:
>
>
> ----- Original Message -----
>> From: "Xavier Hernandez" <xhernandez at datalab.es>
>> To: "Gluster Devel" <gluster-devel at gluster.org>, "Krishnan Parthasarathi" <kparthas at redhat.com>, "Raghavendra
>> Gowdappa" <rgowdapp at redhat.com>
>> Cc: "Dan Lambright" <dlambrig at redhat.com>
>> Sent: Monday, October 27, 2014 11:07:40 PM
>> Subject: Quota problems with dispersed volumes
>>
>> Hi,
>>
>> testing quota on a dispersed volume I've found a problem on how the
>> total used space is calculated.
>>
>> # gluster volume create test disperse server{0..2}:/bricks/disperse
>> # gluster volume start test
>> # gluster volume quota test enable
>> # gluster volume quota test limit-usage / 1GB
>> # gluster volume quota test list
>> Path  H-L    S-L  Used    Available  S-L exceeded?  H-L exceeded?
>> -----------------------------------------------------------------
>> /     1.0GB  80%  0Bytes  1.0GB      No             No
>> # mount -t glusterfs server0:/test /gluster/test
>> # dd if=/dev/zero of=/gluster/test/file bs=1024k count=512
>> # ls -lh /gluster/test
>> total 512M
>> -rw-r--r-- 1 root root 512M Oct 27 18:29 file
>> # gluster volume quota test list
>> Path  H-L    S-L  Used    Available  S-L exceeded? H-L exceeded?
>> ----------------------------------------------------------------
>> /     1.0GB  80%  256.0MB 768.0MB    No            No
>>
>> As you can see quota seems to only count the space used by the file in
>> one of the bricks (each file uses 256MB on each brick).
>>
>> How would be the best way to solve this problem ? I don't know quota
>> internals so I'm a bit lost about where to adjust real file sizes...
>
> We use extended attribute with key "trusted.glusterfs.quota.size" to get the size of a directory/file. The value for this key is probed in lookup and getxattr calls. You can implement logic to handle this key appropriately in disperse xlator to give a proper size to higher layers. In your existing implementation you might have been probably passing xattrs from one of the bricks and hence seeing size from only one brick.

I think this patch fixes the problem:

     http://review.gluster.org/8990

Thanks,

Xavi

>
>
>>
>> Thanks,
>>
>> Xavi
>>


More information about the Gluster-devel mailing list