Bug 1473636

Summary: Launch metadata heal in discover code path.
Product: [Community] GlusterFS Reporter: Ravishankar N <ravishankar>
Component: replicateAssignee: Ravishankar N <ravishankar>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: mainlineCC: bugs
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-3.13.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1488168 1492010 (view as bug list) Environment:
Last Closed: 2017-12-08 17:35:17 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:
Bug Depends On:    
Bug Blocks: 1470599, 1488168, 1492010    

Description Ravishankar N 2017-07-21 10:51:49 UTC
Description of problem:

It was found that when I/O was going on in a  rep 2 volume and an add-brick was done to convert it to rep-3, mkdir failed on the newly added brick because the parent dir on that brick did not contain dht layout xattr due to which posix failed the mkdir (see BZ 1470599 if you have view permissions).

So fuse guarantees that a lookup (named OR gfid lookup) is issued before the mkdir. In afr, metadata heals (which heal the xattrs including dht xattrs) happen only as a part of named lookups. Fix it to include gfid lookups as well.

Note that named lookups can do name heals (if entry doesn't exist on the 3rd brick), gfid lookups can't do that. The most we can do is perform metadata heals if the entry is already present in the brick.

Comment 1 Worker Ant 2017-07-21 10:53:11 UTC
REVIEW: https://review.gluster.org/17850 (afr: heal metadata in discover code path) posted (#1) for review on master by Ravishankar N (ravishankar)

Comment 2 Worker Ant 2017-07-23 11:16:43 UTC
REVIEW: https://review.gluster.org/17850 (afr: heal metadata in discover code path) posted (#2) for review on master by Ravishankar N (ravishankar)

Comment 3 Worker Ant 2017-08-16 11:46:51 UTC
COMMIT: https://review.gluster.org/17850 committed in master by Ravishankar N (ravishankar) 
------
commit 468ca877807625817b72921d1e9585036687b640
Author: Ravishankar N <ravishankar>
Date:   Fri Jul 21 15:21:20 2017 +0530

    afr: heal metadata in discover code path
    
    During graph switch, if fuse sends nameless (gfid) lookups, afr takes
    the discover code path to serve it. If there are pending metadata heals,
    they do not happen unless an inode refresh happens as a part of
    discover (which is not guaranteed to happen always).
    
    This patch fixes it by attempting metadata heal as a part of discover,
    just like how it is done in lookup code path.
    
    Also removed creating superfluous  heal frames when launching heal.
    
    Change-Id: I49868649361ebe5d70b6ea150f4686169b6c3070
    BUG: 1473636
    Signed-off-by: Ravishankar N <ravishankar>
    Reviewed-on: https://review.gluster.org/17850
    Smoke: Gluster Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>
    Reviewed-by: Karthik U S <ksubrahm>

Comment 4 Ravishankar N 2017-09-02 15:31:17 UTC
Sending one more patch based on post-merge review comments for patch in comment #3.

Comment 5 Worker Ant 2017-09-02 15:39:01 UTC
REVIEW: https://review.gluster.org/18187 (afr: discover/lookup heal fixes) posted (#1) for review on master by Ravishankar N (ravishankar)

Comment 6 Worker Ant 2017-09-04 05:31:35 UTC
COMMIT: https://review.gluster.org/18187 committed in master by Pranith Kumar Karampuri (pkarampu) 
------
commit 37e16afa4853dcb5df6d6d0c91a6afd960c3a901
Author: Ravishankar N <ravishankar>
Date:   Sat Sep 2 20:24:00 2017 +0530

    afr: discover/lookup heal fixes
    
    Addresses review comments in commit 468ca877807625817b72921d1e9585036687b640
    
    Change-Id: I04b1bd3b00abfd6758798d6272954e36a24249a9
    BUG: 1473636
    Signed-off-by: Ravishankar N <ravishankar>
    Reviewed-on: https://review.gluster.org/18187
    Smoke: Gluster Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>
    Reviewed-by: Pranith Kumar Karampuri <pkarampu>

Comment 7 Shyamsundar 2017-12-08 17:35: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.13.0, please open a new bug report.

glusterfs-3.13.0 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://lists.gluster.org/pipermail/announce/2017-December/000087.html
[2] https://www.gluster.org/pipermail/gluster-users/