Bug 1203081

Summary: Entries in indices/xattrop directory not removed appropriately
Product: [Community] GlusterFS Reporter: Ravishankar N <ravishankar>
Component: replicateAssignee: Ravishankar N <ravishankar>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3.6.2CC: atalur, bugs, gluster-bugs, hchiramm, rabhat, ravishankar
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1190069 Environment:
Last Closed: 2015-11-17 12:14:49 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: 1190069    
Bug Blocks: 1184460    

Description Ravishankar N 2015-03-18 04:23:05 UTC
+++ This bug was initially created as a clone of Bug #1190069 +++

Description of problem:

Entries were found in indices/xattrop dir whose corresponding files had 0 value set for trusted.afr. xattrs. Such entries should be removed once known that heal is not required.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

--- Additional comment from Anand Avati on 2015-02-19 12:08:03 EST ---

REVIEW: http://review.gluster.org/9714 (afr: remove stale index entries) posted (#1) for review on master by Ravishankar N (ravishankar)

--- Additional comment from Anand Avati on 2015-02-20 05:31:30 EST ---

REVIEW: http://review.gluster.org/9714 (afr: remove stale index entries) posted (#2) for review on master by Ravishankar N (ravishankar)

--- Additional comment from Anand Avati on 2015-02-21 03:07:18 EST ---

REVIEW: http://review.gluster.org/9714 (afr: remove stale index entries) posted (#3) for review on master by Ravishankar N (ravishankar)

--- Additional comment from Anand Avati on 2015-03-05 08:02:28 EST ---

REVIEW: http://review.gluster.org/9714 (afr: remove stale index entries) posted (#4) for review on master by Ravishankar N (ravishankar)

--- Additional comment from Anand Avati on 2015-03-05 11:38:05 EST ---

REVIEW: http://review.gluster.org/9714 (afr: remove stale index entries) posted (#5) for review on master by Ravishankar N (ravishankar)

--- Additional comment from Anand Avati on 2015-03-10 02:55:05 EDT ---

REVIEW: http://review.gluster.org/9714 (afr: remove stale index entries) posted (#6) for review on master by Ravishankar N (ravishankar)

--- Additional comment from Anand Avati on 2015-03-11 20:24:48 EDT ---

REVIEW: http://review.gluster.org/9714 (afr: remove stale index entries) posted (#7) for review on master by Ravishankar N (ravishankar)

--- Additional comment from Anand Avati on 2015-03-13 02:56:39 EDT ---

REVIEW: http://review.gluster.org/9714 (afr: remove stale index entries) posted (#8) for review on master by Ravishankar N (ravishankar)

--- Additional comment from Anand Avati on 2015-03-17 12:14:48 EDT ---

COMMIT: http://review.gluster.org/9714 committed in master by Pranith Kumar Karampuri (pkarampu) 
------
commit c8be9af5f54aa3e42dffee4024d2915743258242
Author: Ravishankar N <ravishankar>
Date:   Thu Mar 5 11:29:25 2015 +0000

    afr: remove stale index entries
    
    Problem:
    During pre-op phase, the index xlator
    1. Creates the entry inside .glusterfs/indices/xattrop
    2. Winds the xattrop fop to posix to mark dirty/pending changelogs.
    If the brick crashes after 1, the xattrop entry becomes stale and never
    gets removed by shd during subsequent crawls because there is nothing to
    heal (changelogs are zero).
    
    Though the stale entry does not get displayed in the output of 'heal
    info' command, it nevertheless stays there forever unless a new write
    transaction is performed on the file.
    
    Fix:
    During index self-heal if afr xattrs are found to be clean (indicated by
    ret value of 2 on a call to afr_shd_selfheal(), send a dummy
    post-op with all 0s for the xattr values, which makes the index xlator
    to unlink the stale entry.
    
    Change-Id: I02cb2bc937f2e3f3f3cb35d67b006664dc7ef919
    BUG: 1190069
    Signed-off-by: Ravishankar N <ravishankar>
    Reviewed-on: http://review.gluster.org/9714
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Anuradha Talur <atalur>
    Reviewed-by: Pranith Kumar Karampuri <pkarampu>
    Tested-by: Pranith Kumar Karampuri <pkarampu>

Comment 1 Anand Avati 2015-03-18 05:16:17 UTC
REVIEW: http://review.gluster.org/9920 (afr: remove stale index entries) posted (#1) for review on release-3.6 by Ravishankar N (ravishankar)

Comment 2 Anand Avati 2015-03-25 08:57:10 UTC
COMMIT: http://review.gluster.org/9920 committed in release-3.6 by Raghavendra Bhat (raghavendra) 
------
commit e4d8dc2e80f0683c69481c47875c01c8c3723814
Author: Ravishankar N <ravishankar>
Date:   Wed Mar 18 10:30:12 2015 +0530

    afr: remove stale index entries
    
    Backport of http://review.gluster.org/9714
    
    Problem:
    During pre-op phase, the index xlator
    1. Creates the entry inside .glusterfs/indices/xattrop
    2. Winds the xattrop fop to posix to mark dirty/pending changelogs.
    If the brick crashes after 1, the xattrop entry becomes stale and never
    gets removed by shd during subsequent crawls because there is nothing to
    heal (changelogs are zero).
    
    Though the stale entry does not get displayed in the output of 'heal info'
    command, it nevertheless stays there forever unless a new write tansaction
    is performed on the file.
    
    Fix:
    During index self-heal if afr xattrs are found to be clean (indicated by
    ret value of 2 on a call to afr_shd_selfheal(), send a dummy
    post-op with all 0s for the xattr values, which makes the index xlator
    to unlink the stale entry.
    
    Change-Id: Iffb171e40490abd8d44df09ccc058b5da67baafe
    BUG: 1203081
    Signed-off-by: Ravishankar N <ravishankar>
    Reviewed-on: http://review.gluster.org/9920
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Pranith Kumar Karampuri <pkarampu>
    Reviewed-by: Raghavendra Bhat <raghavendra>