Bug 1153900 - Enabling Quota on existing data won't create pgfid xattrs
Summary: Enabling Quota on existing data won't create pgfid xattrs
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: quota
Version: 3.5.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: bugs@gluster.org
QA Contact:
URL:
Whiteboard:
Depends On: 1147378
Blocks: glusterfs-3.5.3
TreeView+ depends on / blocked
 
Reported: 2014-10-17 05:41 UTC by Krutika Dhananjay
Modified: 2015-12-01 16:45 UTC (History)
7 users (show)

Fixed In Version: glusterfs-3.5.3
Doc Type: Bug Fix
Doc Text:
Clone Of: 1147378
Environment:
Last Closed: 2014-11-21 16:03:17 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Krutika Dhananjay 2014-10-17 05:41:23 UTC
+++ This bug was initially created as a clone of Bug #1147378 +++

+++ This bug was initially created as a clone of Bug #1146830 +++

Description of problem:
pgfid xattrs are used to construct the ancestry path in case of nameless lookups. rhs-2.1 had code to create pgfid xattr in lookup if it is not already there. However rhs-3.0 doesn't have pgfid healing code and hence pgfid xattrs won't be created on existing data. Since nfs relies on nameless lookups heavily, quota enforcement through nfs would be inconsistent.

[root@booradley 6]# gluster volume info
 
Volume Name: dist
Type: Distribute
Volume ID: 2b1406b1-cdb6-47b5-9d80-1cc035b73c5e
Status: Started
Number of Bricks: 1
Transport-type: tcp
Bricks:
Brick1: booradley:/home/export/dist1

[root@booradley dist1]# mount
localhost:dist on /mnt/glusterfs type fuse.glusterfs (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,max_read=131072)

[root@booradley dist1]# ls /mnt/glusterfs/1/2/3/4/5/6/file 
/mnt/glusterfs/1/2/3/4/5/6/file

[root@booradley 6]# getfattr -d -m. -e hex /home/export/dist1/1/2/3/4/5/6/file 
getfattr: Removing leading '/' from absolute path names
# file: home/export/dist1/1/2/3/4/5/6/file
security.selinux=0x756e636f6e66696e65645f753a6f626a6563745f723a686f6d655f726f6f745f743a733000
trusted.gfid=0xa294cb915fd3412ab3ca2a3579e1820b

[root@booradley 6]# gluster volume quota dist enable
volume quota : success

[root@booradley 6]# getfattr -d -m. -e hex /home/export/dist/1/2/3/4/5/6/file 
getfattr: Removing leading '/' from absolute path names
# file: home/export/dist1/1/2/3/4/5/6/file
security.selinux=0x756e636f6e66696e65645f753a6f626a6563745f723a686f6d655f726f6f745f743a733000
trusted.gfid=0xa294cb915fd3412ab3ca2a3579e1820b
trusted.glusterfs.quota.11e18af2-ecda-4445-8fc7-e0f49d847b39.contri=0x0000000000000000

As can be seen above pgfid xattr is missing on file.

Version-Release number of selected component (if applicable):
rhs-3.0 and rhs-3.0.1 (rhs-2.1.x don't have this problem)

How reproducible:
always

Steps to Reproduce:
1. create some data on mount point
2. enable quota
3. check for pgfid xattr on backend

Actual results:
pgfid xattr not present.

Expected results:
xattr should be present.

Additional info:

--- Additional comment from Raghavendra G on 2014-09-26 04:08:15 EDT ---

However, on newly created files, xattr is created as can be seen below:

[root@booradley 6]# touch /mnt/glusterfs/1/2/3/4/5/6/newfile
[root@booradley 6]# ls /mnt/glusterfs/1/2/3/4/5/6/
file  newfile

[root@booradley 6]# getfattr -d -m. -e hex /home/export/dist1/1/2/3/4/5/6/newfile 
getfattr: Removing leading '/' from absolute path names
# file: home/export/dist1/1/2/3/4/5/6/newfile
security.selinux=0x756e636f6e66696e65645f753a6f626a6563745f723a686f6d655f726f6f745f743a733000

trusted.gfid=0x125f6c9c0a3f4c439baab1721119b1ba

trusted.glusterfs.quota.11e18af2-ecda-4445-8fc7-e0f49d847b39.contri=0x0000000000000000

trusted.pgfid.11e18af2-ecda-4445-8fc7-e0f49d847b39=0x00000001

As can be seen above trusted.pgfid.xxxx xattr is created on newfile.


--- Additional comment from Anand Avati on 2014-09-29 03:36:55 EDT ---

REVIEW: http://review.gluster.org/8878 (glusterd/quota: Heal pgfid xattr on existing data when the quota is enable) posted (#1) for review on master by Vijaikumar Mallikarjuna (vmallika)

--- Additional comment from Anand Avati on 2014-09-30 07:51:24 EDT ---

REVIEW: http://review.gluster.org/8890 (glusterd/quota: Heal pgfid xattr on existing data when the quota is enable) posted (#1) for review on release-3.6 by Vijaikumar Mallikarjuna (vmallika)

--- Additional comment from Anand Avati on 2014-09-30 12:42:05 EDT ---

COMMIT: http://review.gluster.org/8878 committed in master by Vijay Bellur (vbellur) 
------
commit f95a25c35e1ced6a3c05030d34555b757b14e1c9
Author: vmallika <vmallika>
Date:   Mon Sep 29 13:02:30 2014 +0530

    glusterd/quota: Heal pgfid xattr on existing data when the quota is
    enable
    
    The pgfid extended attributes are used to construct the ancestry path
    (from the file to the volume root) for nameless lookups on files.
    As NFS relies on nameless lookups heavily, quota enforcement through NFS
    would be inconsistent if quota were to be enabled on a volume with
    existing data.
    
    Solution is to heal the pgfid extended attributes as a part of lookup
    perfomed by quota-crawl process. In a posix lookup check for pgfid xattr
    and if it is missing set the xattr.
    
    Change-Id: I5912ea96787625c496bde56d43ac9162596032e9
    BUG: 1147378
    Signed-off-by: vmallika <vmallika>
    Reviewed-on: http://review.gluster.org/8878
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Vijay Bellur <vbellur>

Comment 1 Anand Avati 2014-10-17 05:57:11 UTC
REVIEW: http://review.gluster.org/8938 (glusterd/quota: Heal pgfid xattr on existing data when the quota is enable) posted (#1) for review on release-3.5 by Krutika Dhananjay (kdhananj)

Comment 2 Anand Avati 2014-10-20 16:13:38 UTC
COMMIT: http://review.gluster.org/8938 committed in release-3.5 by Niels de Vos (ndevos) 
------
commit b0ed286e9b53c5ad24f04686cd6ddfad940b87f3
Author: vmallika <vmallika>
Date:   Mon Sep 29 13:02:30 2014 +0530

    glusterd/quota: Heal pgfid xattr on existing data when the quota is
    enable
    
            Backport of: http://review.gluster.org/8878
    
    The pgfid extended attributes are used to construct the ancestry path
    (from the file to the volume root) for nameless lookups on files.
    As NFS relies on nameless lookups heavily, quota enforcement through NFS
    would be inconsistent if quota were to be enabled on a volume with
    existing data.
    
    Solution is to heal the pgfid extended attributes as a part of lookup
    perfomed by quota-crawl process. In a posix lookup check for pgfid xattr
    and if it is missing set the xattr.
    
    Change-Id: I956128907aa1d975cd5719ed3ab2f4f9b37d4c31
    BUG: 1153900
    Signed-off-by: vmallika <vmallika>
    Signed-off-by: Krutika Dhananjay <kdhananj>
    Reviewed-on: http://review.gluster.org/8938
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Niels de Vos <ndevos>

Comment 3 Niels de Vos 2014-11-05 09:25:11 UTC
The second Beta for GlusterFS 3.5.3 has been released [1]. Please verify if the release solves this bug report for you. In case the glusterfs-3.5.3beta2 release does not have a resolution for this issue, leave a comment in this bug and move the status to ASSIGNED. If this release fixes the problem for you, leave a note and change the status to VERIFIED.

Packages for several distributions have been made available on [2] to make testing easier.

[1] http://supercolony.gluster.org/pipermail/gluster-users/2014-November/019359.html
[2] http://download.gluster.org/pub/gluster/glusterfs/qa-releases/3.5.3beta2/

Comment 4 Niels de Vos 2014-11-21 16:03:17 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.5.3, please reopen this bug report.

glusterfs-3.5.3 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://supercolony.gluster.org/pipermail/announce/2014-November/000042.html
[2] http://supercolony.gluster.org/pipermail/gluster-users/


Note You need to log in before you can comment on or make changes to this bug.