Bug 765153 (GLUSTER-3421)

Summary: quota: directory limit for specified quota gets crossed
Product: [Community] GlusterFS Reporter: Saurabh <saurabh>
Component: quotaAssignee: vpshastry <vshastry>
Status: CLOSED WORKSFORME QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: mainlineCC: admin, amarts, gluster-bugs, nsathyan, redhat.bugs
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: glusterfs-3.3.1, (and that means 3.4.0+ versions too) Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 848246 (view as bug list) Environment:
Last Closed: 2013-02-04 09:24:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 848246    

Description Saurabh 2011-08-16 11:50:01 UTC
this issue is found on 3.2.3qa1

root@Centos1 dir2]# gluster volume quota dist-rep list 
	path		  limit_set	     size
----------------------------------------------------------------------------------
/dir1                      10MB               11.1MB
/dir2                      10MB               15.1MB
[root@Centos1 dir2]# pwd
/mnt/glusterfs-test/dir2
[root@Centos1 dir2]# mount | grep glusterfs
glusterfs#10.1.12.135:/dist-rep on /mnt/glusterfs-test type fuse (rw,allow_other,default_permissions,max_read=131072)
[root@Centos1 dir2]# gluster volume info dist-rep

Volume Name: dist-rep
Type: Distributed-Replicate
Status: Started
Number of Bricks: 2 x 2 = 4
Transport-type: tcp
Bricks:
Brick1: 10.1.12.134:/export/d1
Brick2: 10.1.12.135:/export/r1
Brick3: 10.1.12.134:/export/d2
Brick4: 10.1.12.135:/export/r2
Options Reconfigured:
features.limit-usage: /dir1:10MB,/dir2:10MB
features.quota: on



[root@Centos1 dir2]# glusterfs -V
glusterfs 3.2.3qa1 built on Aug  8 2011 08:33:31
Repository revision: git://git.gluster.com/glusterfs.git
Copyright (c) 2006-2010 Gluster Inc. <http://www.gluster.com>
GlusterFS comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GlusterFS under the terms of the GNU General Public License.

Comment 1 Anand Avati 2011-08-23 05:37:37 UTC
CHANGE: http://review.gluster.com/304 (without which, quota would get confused about the total size) merged in master by Vijay Bellur (vijay)

Comment 2 Amar Tumballi 2011-09-20 03:06:07 UTC
*** Bug 3165 has been marked as a duplicate of this bug. ***

Comment 3 Saurabh 2011-09-29 09:57:43 UTC
[root@Centos3 dir1]# ls
f.1  f.10  f.2  f.3  f.4  f.5  f.6  f.7  f.8  f.9
[root@Centos3 dir1]# 
[root@Centos3 dir1]# 
[root@Centos3 dir1]# gluster volume quota test list
	path		  limit_set	     size
----------------------------------------------------------------------------------
/                           1GB               10.1MB
/dir1                      10MB               10.0MB
/dir2                      10MB               0Bytes
[root@Centos3 dir1]# gluster volume quota test remove /
Removed quota limit on /
[root@Centos3 dir1]# gluster volume quota test list
	path		  limit_set	     size
----------------------------------------------------------------------------------
/dir1                      10MB               10.0MB
/dir2                      10MB               0Bytes



[root@Centos3 dir2]# gluster volume quota test list
	path		  limit_set	     size
----------------------------------------------------------------------------------
/dir1                      10MB               10.0MB
/dir2                      10MB               10.0MB
[root@Centos3 dir2]# glusterfs -V
glusterfs 3.3.0qa12 built on Sep 28 2011 02:58:35
Repository revision: git://git.gluster.com/glusterfs.git
Copyright (c) 2006-2011 Gluster Inc. <http://www.gluster.com>
GlusterFS comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GlusterFS under the terms of the GNU General Public License.
[root@Centos3 dir2]#

Comment 4 Saurabh 2011-10-20 10:03:26 UTC
finding similar kind of problem on 3.2.5qa2,

concern is that the data is moved from one directory to other directory over nfs mount.

Note:- just before this test I had tried replace-brick test, though quota calculation was correct after that test.


[root@RHEL6 ~]# /opt/glusterfs/3.2.5qa2//sbin/gluster volume quota dist-rep list
	path		  limit_set	     size
----------------------------------------------------------------------------------
/                           2MB              960.0KB
[root@RHEL6 ~]# /opt/glusterfs/3.2.5qa2//sbin/gluster volume quota dist-rep list
	path		  limit_set	     size
----------------------------------------------------------------------------------
/                           2MB                1.0MB
[root@RHEL6 ~]# /opt/glusterfs/3.2.5qa2//sbin/gluster volume quota dist-rep list
	path		  limit_set	     size
----------------------------------------------------------------------------------
/                           2MB                1.0MB
[root@RHEL6 ~]# /opt/glusterfs/3.2.5qa2//sbin/gluster volume quota dist-rep list
	path		  limit_set	     size
----------------------------------------------------------------------------------
/                           2MB              832.0KB
[root@RHEL6 ~]# /opt/glusterfs/3.2.5qa2//sbin/gluster volume quota dist-rep list
	path		  limit_set	     size
----------------------------------------------------------------------------------
/                           2MB              832.0KB
[root@RHEL6 ~]# /opt/glusterfs/3.2.5qa2//sbin/gluster volume quota dist-rep limit-usage /d1/d3 1MB
limit set on /d1/d3
[root@RHEL6 ~]# /opt/glusterfs/3.2.5qa2//sbin/gluster volume quota dist-rep limit-usage /d1/d4 1MB
limit set on /d1/d4

root@RHEL6 ~]# /opt/glusterfs/3.2.5qa2//sbin/gluster volume quota dist-rep list
	path		  limit_set	     size
----------------------------------------------------------------------------------
/                           2MB              832.0KB
/d1/d3                      1MB              192.0KB
/d1/d4                      1MB               0Bytes
[root@RHEL6 ~]# /opt/glusterfs/3.2.5qa2//sbin/gluster volume quota dist-rep list
	path		  limit_set	     size
----------------------------------------------------------------------------------
/                           2MB                1.2MB
/d1/d3                      1MB              192.0KB
/d1/d4                      1MB              384.0KB

Comment 5 Richard 2013-01-23 21:18:15 UTC
This seems to work for me in 3.3.1-8.fc18

Comment 6 Amar Tumballi 2013-02-04 09:24:45 UTC
as per comment #5, and also, please test quota in scale of GBs and keep ~1-3% offset for errors considering its distributed quota implementation, and is hard to achieve.