Bug 797997

Summary: stale files in indices/ directory
Product: [Community] GlusterFS Reporter: Amar Tumballi <amarts>
Component: unclassifiedAssignee: Pranith Kumar K <pkarampu>
Status: CLOSED NOTABUG QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: mainlineCC: gluster-bugs, vraman
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-03-05 12:24:50 UTC Type: ---
Regression: --- Mount Type: fuse
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Amar Tumballi 2012-02-27 18:36:03 UTC
Description of problem:
Ran Posix-compliance test on a newly created/mounted volume, deleted all the empty directories of posix tests, so that there are no files or directories on mount point. But on the backend saw some stale files remaining in hidden directory.


Version-Release number of selected component (if applicable):
master (git head : c2c82c360fda20533093c27c82ce0725cf40cab5)

How reproducible:
3/3

Steps to Reproduce:
1. create 2x2 dist-replica volume; enable quota;
2. start the volume; mount it;
3. run posix tests; remove all the entries from the mountpoint after tests..
4. ls -l /export/dir/.glusterfs/*/*/* shows stale entries.
  
Actual results:
stale files seen

Expected results:
no files should be in those directories

Comment 1 Pranith Kumar K 2012-03-05 12:24:50 UTC
  Index xlator does not delete the index file on unlink/rmdir.
   The stale entries will be there only till the next index-self-heal (every 10 minutes) is performed on it.
One thing to note is that, for the self-heal to happen atleast 2 subvolumes of the replica subvols should be up.

[root@pranithk-laptop repl2]# ls /gfs/repl2_?/.glusterfs/indices/xattrop | wc -l
380
[root@pranithk-laptop repl2]# sleep 600 && ls /gfs/repl2_?/.glusterfs/indices/xattrop | wc -l << one of the subvols is down.
380
[root@pranithk-laptop repl2]# gluster volume start repl2 force
Starting volume repl2 has been successful
[root@pranithk-laptop repl2]# sleep 600 && ls /gfs/repl2_?/.glusterfs/indices/xattrop | wc -l << both the subvols are up.
3
[root@pranithk-laptop repl2]# ls /gfs/repl2_?/.glusterfs/indices/xattrop
/gfs/repl2_0/.glusterfs/indices/xattrop:

/gfs/repl2_1/.glusterfs/indices/xattrop:
[root@pranithk-laptop repl2]# 

Pranith