Bug 1027525

Summary: quota: quota list and quota list <path> returns different information for same path
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Jonathan Holloway <jholloway>
Component: glusterdAssignee: Raghavendra G <rgowdapp>
Status: CLOSED ERRATA QA Contact: Jonathan Holloway <jholloway>
Severity: high Docs Contact:
Priority: high    
Version: 2.1CC: grajaiya, kparthas, rtalur, saujain, vagarwal, vbellur
Target Milestone: ---Keywords: Regression, ZStream
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: glusterfs-3.4.0.40rhs-1 Doc Type: Bug Fix
Doc Text:
Previously, volume quota list command would return different disk usage values for the same directory, on which quota limits were set, when invoked with a directory path argument and without any argument supplied. Now, with this update, both the invocations of the volume quota list command would return the same disk usage values for a given directory.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-27 15:46:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jonathan Holloway 2013-11-07 02:24:44 UTC
Description of problem:

gluster volume quota <vol-name> list
...and...
gluster volume quota <vol-name> list <path>
... return different values in the "Used" column for the same path.

Version-Release number of selected component (if applicable):
glusterfs-server-3.4.0.39rhs-1.el6rhs.x86_64

How reproducible:
Every time.

Steps to Reproduce:
1. Create a volume of 6x2, start it
2. Enable and set quota of 1GB on / path
3. On client, mount the volume using Fuse
4. On client, create data inside the volume until limit is reached.
5. Execute the following commands:
        gluster volume quota <vol-name> list
        gluster volume quota <vol-name> list /

Actual results:
Used number in both command results for the same path are different.

# gluster volume quota quota-test-setup list
                  Path                   Hard-limit Soft-limit   Used  Available
--------------------------------------------------------------------------------
/                                          1.0GB       80%       1.8GB  0Bytes
# gluster volume quota quota-test-setup list /
                  Path                   Hard-limit Soft-limit   Used  Available
--------------------------------------------------------------------------------
/                                          1.0GB       80%     963.8MB  60.2MB


Expected results:
"Used" values in both commands for the same path should match the correct usage.

Additional info:

du for the directory on the client shows...
# du -xhs .
1.8G	.

Comment 2 Saurabh 2013-11-07 06:25:36 UTC
updates from my setup,

it can easily be concluded that the information displayed bout quota stats is not same by quota list and quota list <path> commands

[root@quota6 ~]# gluster volume quota dist-rep list /
                  Path                   Hard-limit Soft-limit   Used  Available
--------------------------------------------------------------------------------
/                                          2.9TB       80%       1.4TB   1.5TB
[root@quota6 ~]# gluster volume quota dist-rep list 
                  Path                   Hard-limit Soft-limit   Used  Available
--------------------------------------------------------------------------------
/                                          2.9TB       80%       2.7TB 215.5GB
/qa1                                     512.0GB       80%     512.0GB  26.5MB
/qa2                                     512.0GB       80%     512.0GB  0Bytes
/qa3                                     100.0GB       80%     100.0GB  0Bytes
/qa4                                     100.0GB       80%     100.0GB  0Bytes
/qa1/dir1                                500.0GB       80%     412.0GB  88.0GB
/qa2/dir1                                500.0GB       80%     412.0GB  88.0GB
/qa5                                     500.0GB       80%     500.0GB  0Bytes
/qa6                                     500.0GB       80%     500.0GB  0Bytes
/qa7                                     500.0GB       80%     298.3GB 201.7GB
/qa8                                     800.0GB       80%     234.1GB 565.9GB
[root@quota6 ~]# gluster volume quota dist-rep list /qa8
                  Path                   Hard-limit Soft-limit   Used  Available
--------------------------------------------------------------------------------
/qa8                                     800.0GB       80%     346.8GB 453.2GB
[root@quota6 ~]# 
[root@quota6 ~]# gluster volume quota dist-rep list /qa7
                  Path                   Hard-limit Soft-limit   Used  Available
--------------------------------------------------------------------------------
/qa7                                     500.0GB       80%      0Bytes 500.0GB
[root@quota6 ~]# gluster volume quota dist-rep list /qa6
                  Path                   Hard-limit Soft-limit   Used  Available
--------------------------------------------------------------------------------
/qa6                                     Limit not set
[root@quota6 ~]# 
[root@quota6 ~]# 
[root@quota6 ~]# gluster volume quota dist-rep list /qa5
                  Path                   Hard-limit Soft-limit   Used  Available
--------------------------------------------------------------------------------
/qa5                                     Limit not set
[root@quota6 ~]# gluster volume quota dist-rep list /qa4
                  Path                   Hard-limit Soft-limit   Used  Available
--------------------------------------------------------------------------------
/qa4                                     100.0GB       80%      33.3GB  66.7GB

Comment 4 Jonathan Holloway 2013-11-08 02:31:35 UTC
Using the steps listed in "Steps to Reproduce" above, I was unable to reproduce the issue on glusterfs-3.4.0.40rhs-1. Moving to verified.

Output from automation scripts...
:: [ 18:58:42 ] :: [ INFO    ] :: FULL LIST (gluster volume quota quota-test-setup list)
                  Path                   Hard-limit Soft-limit   Used  Available
--------------------------------------------------------------------------------
/                                          1.0GB       80%       2.2GB  0Bytes
:: [ 18:58:42 ] :: [ INFO    ] :: ROOT LIST (gluster volume quota quota-test-setup list /)
                  Path                   Hard-limit Soft-limit   Used  Available
--------------------------------------------------------------------------------
/                                          1.0GB       80%       2.2GB  0Bytes
:: [   PASS   ] :: USED VALUES 2.2GB AND 2.2GB MATCH FOR QUOTA PATH /

Comment 5 errata-xmlrpc 2013-11-27 15:46:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-1769.html