When quota is disabled and this operation gets terminated without completely cleaning up the quota xattrs. Now if quota is enabled again, this can mess up the quota accounting
Upstream patch: http://review.gluster.org/#/c/12386/
upstream patch: http://review.gluster.org/#/c/12386/ release-3.7 patch: http://review.gluster.org/#/c/12487/ downstream patch: https://code.engineering.redhat.com/gerrit/60609
Verification failed. Able to reproduce this bug again on build glusterfs-libs-3.7.5-6.el7rhgs.x86_64 [root@localhost newtest]# gluster v quota testvol disable Disabling quota will delete all the quota configuration. Do you want to continue? (y/n) y ^V^C [root@localhost newtest]# gluster v info Volume Name: testvol Type: Distributed-Replicate Volume ID: 6e5023e1-5942-4146-933e-3d06d6921029 Status: Started Number of Bricks: 2 x 2 = 4 Transport-type: tcp Bricks: Brick1: 10.70.47.143:/rhs/brick3/b1 Brick2: 10.70.47.145:/rhs/brick3/b2 Brick3: 10.70.47.2:/rhs/brick3/b3 Brick4: 10.70.47.3:/rhs/brick3/b4 Options Reconfigured: features.inode-quota: off features.quota: off performance.readdir-ahead: on [root@localhost newtest]# gluster v quota testvol enable [root@localhost newtest]# gluster v quota testvol limit-usage / 2GB quota command failed : Failed to find the directory /var/run/gluster/testvol/. Reason : No such file or directory
Hi Anil, You have mentioned two problems in comment# 5 Problem 1) [root@localhost newtest]# gluster v quota testvol disable Disabling quota will delete all the quota configuration. Do you want to continue? (y/n) y ^V^C [root@localhost newtest]# gluster v info Options Reconfigured: features.inode-quota: off features.quota: off Once you execute command 'gluster v quota testvol disable', CLI will send the request to glusterd to perform the operation and waits for the result response from glusterd. If you kill CLI it will not receive and response, but glusterd will continue to execute the operation you initiated. Problem 2) [root@localhost newtest]# gluster v quota testvol enable [root@localhost newtest]# gluster v quota testvol limit-usage / 2GB quota command failed : Failed to find the directory /var/run/gluster/testvol/. Reason : No such file or directory Need to investigate wht limit-usage on '/' is failing. File a new new bug for this 2nd problem I will investigate.
Consider below example 1) When a quota is disabled, glusterd will initiate a backend process 'find / | xargs setxattr -x ....' to clean up all quota xattrs in the backend. 2) If there is a file /dir/a (if a is 1MB, file a and /dir and / will be accounted 1MB) 3) If a clanup process clean xattr from file a, but failed to cleanup xattr on /dir and / (may be node rebooted or process terminated) 4) now if quota is enabled file 'a' will be accounted 1MB, this 1MB is added to /dir and / /dir and / already has 1MB accounted which was not cleaned and after adding 1MB the quota usage becomes 2MB which is wrong... To prevent this problem version number is added to the quota xattrs (suffixed in key)and this number is incremented on every enable operation On first enable: trusted.glusterfs.quota.size.1=0x0000000008c00000000000000000000e0000000000000001 trusted.glusterfs.quota.limit-set.1=0x0000000100000000ffffffffffffffff trusted.glusterfs.quota.contri.0x0000000000000001.1=0x0000000008c00000000000000000000e0000000000000001 On second enable: trusted.glusterfs.quota.size.2=0x0000000008c00000000000000000000e0000000000000001 trusted.glusterfs.quota.limit-set.2=0x0000000100000000ffffffffffffffff trusted.glusterfs.quota.contri.0x0000000000000001.2=0x0000000008c00000000000000000000e0000000000000001
As discussed with Development team, Disabling and enabling will increment the trusted.glusterfs.quota.limit-set.2. Marking this bug verified on build glusterfs-3.7.5-6.el7rhgs.x86_64
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. https://rhn.redhat.com/errata/RHBA-2016-0193.html