Bug 1283036

Summary: Index entries are not being purged in case of file does not exist
Product: [Community] GlusterFS Reporter: Ashish Pandey <aspandey>
Component: replicateAssignee: Ashish Pandey <aspandey>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.7.6CC: atalur, bugs, pkarampu, ravishankar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-3.7.7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1270668 Environment:
Last Closed: 2016-04-19 07:48:11 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: 1270668, 1283045    
Bug Blocks:    

Description Ashish Pandey 2015-11-18 05:01:38 UTC
+++ This bug was initially created as a clone of Bug #1270668 +++

Description of problem:
If a file does not exist on a brick but the index entry is present in XXX/.glusterfs/indices/xattrop, this entry is not getting removed even after 
running index heal.

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

[root@aspandey:/home/blr/aspandey/glusterfs]# glusterfs --version
glusterfs 3.8dev built on Oct 12 2015 10:40:32
Repository revision: git://git.gluster.com/glusterfs.git
Copyright (c) 2006-2013 Red Hat, Inc. <http://www.redhat.com/>
GlusterFS comes with ABSOLUTELY NO WARRANTY.
It is licensed to you under your choice of the GNU Lesser
General Public License, version 3 or any later version (LGPLv3
or later), or the GNU General Public License, version 2 (GPLv2),
in all cases as published by the Free Software Foundation.
[root@aspandey:/home/blr/aspandey/glusterfs]# 


How reproducible:
100%

Steps to Reproduce:
1. Create a replicate volume, mount it and create some files on mount point.
2. add bricks and before executing rebalance, kill one of the new add bricks
3. execute rebalance.
4. add brick again and execute rebalance (some files from written on bricks in [2] will be rebalanced to bricks added in [4]) 
5. start the volume with force
6. start heal
7. heal info shows nothing to be healed  
8. Look into XXX/.glusterfs/indices/xattrop in one of the brick added in [2]. Index entries would still be present.


Actual results:
Indices are present for the file which does not exist on volume 

Expected results:

No indices should be present.

Additional info:


[root@aspandey:/home/blr/aspandey/glusterfs]# gluster v heal repvol info
Brick aspandey:/brick/gluster/R1
Number of entries: 0

Brick aspandey:/brick/gluster/R2
Number of entries: 0

Brick aspandey:/brick/gluster/R11
Number of entries: 0

Brick aspandey:/brick/gluster/R12
Number of entries: 0

Brick aspandey:/brick/gluster/R111
Number of entries: 0

Brick aspandey:/brick/gluster/R112
Number of entries: 0

[root@aspandey:/home/blr/aspandey/glusterfs]# ll /brick/gluster/R11/.glusterfs/indices/xattrop/
total 0
----------. 4 root root 0 Oct 12 10:48 26b306f3-7204-461b-9b61-3147651ee181
----------. 4 root root 0 Oct 12 10:48 2e37a37f-ce9f-4ccc-8c9c-fb4eefded44a
----------. 4 root root 0 Oct 12 10:48 2ea426f0-0e7a-43a3-ae1c-b9463be4062e
----------. 4 root root 0 Oct 12 10:48 xattrop-e5af794a-3622-47be-8b9d-65a9f211975d
[root@aspandey:/home/blr/aspandey/glusterfs]# gluster v info
 
Volume Name: repvol
Type: Distributed-Replicate
Volume ID: e33f7dc2-3a21-4b0f-9965-f039f6dbb003
Status: Started
Number of Bricks: 3 x 2 = 6
Transport-type: tcp
Bricks:
Brick1: aspandey:/brick/gluster/R1
Brick2: aspandey:/brick/gluster/R2
Brick3: aspandey:/brick/gluster/R11
Brick4: aspandey:/brick/gluster/R12
Brick5: aspandey:/brick/gluster/R111
Brick6: aspandey:/brick/gluster/R112
Options Reconfigured:
performance.readdir-ahead: on

--- Additional comment from Vijay Bellur on 2015-10-12 04:24:19 EDT ---

REVIEW: http://review.gluster.org/12336 (cluster/afr : Remove index entries if corresponding               file does not exist.) posted (#1) for review on master by Ashish Pandey (aspandey)

--- Additional comment from Vijay Bellur on 2015-10-16 04:28:12 EDT ---

REVIEW: http://review.gluster.org/12336 (cluster/afr : Remove index entries if corresponding               file does not exist.) posted (#2) for review on master by Ashish Pandey (aspandey)

--- Additional comment from Vijay Bellur on 2015-10-29 12:05:12 EDT ---

REVIEW: http://review.gluster.org/12336 (cluster/afr : Remove stale indices) posted (#3) for review on master by Ashish Pandey (aspandey)

--- Additional comment from Vijay Bellur on 2015-11-16 03:20:12 EST ---

COMMIT: http://review.gluster.org/12336 committed in master by Pranith Kumar Karampuri (pkarampu) 
------
commit 92e3bbbad803688a4dbcbab6bcd35867aa055da1
Author: Ashish Pandey <aspandey>
Date:   Mon Oct 12 13:14:08 2015 +0530

    cluster/afr : Remove stale indices
    
    Change-Id: Iba23338a452b49dc9fe6ae7b4ca108ebc377fe42
    BUG: 1270668
    Signed-off-by: Ashish Pandey <aspandey>
    Reviewed-on: http://review.gluster.org/12336
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Pranith Kumar Karampuri <pkarampu>

Comment 1 Vijay Bellur 2015-11-18 05:22:29 UTC
REVIEW: http://review.gluster.org/12604 (cluster/afr : Remove stale indices) posted (#1) for review on release-3.7 by Ashish Pandey (aspandey)

Comment 2 Vijay Bellur 2015-12-22 10:12:57 UTC
COMMIT: http://review.gluster.org/12604 committed in release-3.7 by Pranith Kumar Karampuri (pkarampu) 
------
commit 7223062cdc1934a6694265cfd73b9cc5a8c4f377
Author: Ashish Pandey <aspandey>
Date:   Mon Oct 12 13:14:08 2015 +0530

    cluster/afr : Remove stale indices
    
    Change-Id: Iba23338a452b49dc9fe6ae7b4ca108ebc377fe42
    BUG: 1283036
    Signed-off-by: Ashish Pandey <aspandey>
    Reviewed-on: http://review.gluster.org/12336
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Pranith Kumar Karampuri <pkarampu>
    Reviewed-on: http://review.gluster.org/12604
    Tested-by: NetBSD Build System <jenkins.org>

Comment 3 Mike McCune 2016-03-28 22:16:42 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 4 Kaushal 2016-04-19 07:48:11 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.7.7, please open a new bug report.

glusterfs-3.7.7 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] https://www.gluster.org/pipermail/gluster-users/2016-February/025292.html
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user