From 6c4908fe3f1a0b7900089b307b311940a2b7e1a1 Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Mon, 27 Jun 2016 15:21:26 +0530 Subject: afr, index: Clean up stale directory and file indices in granular entry sh Backport of: http://review.gluster.org/14832 Specifically when a directory tree is removed (rm -rf) while a brick is down, both the directory index and the name indices of the files and subdirs under it will remain. Self-heal will need to pick up these and remove them. Towards this, afr sh will now also crawl indices/entry-changes and call an rmdir on the dir if the directory index is stale. On the brick side, rmdir fop has been implemented for index xl, which would delete the directory index and its contents if present in a synctask. Change-Id: I08f45201adca56737ec2be1aab5433aebaefefd0 BUG: 1355609 Signed-off-by: Krutika Dhananjay Reviewed-on: http://review.gluster.org/14920 Smoke: Gluster Build System CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Ravishankar N Reviewed-by: Jeff Darcy --- tests/basic/afr/granular-esh/granular-esh.t | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'tests/basic') diff --git a/tests/basic/afr/granular-esh/granular-esh.t b/tests/basic/afr/granular-esh/granular-esh.t index 4adcfc7456a..ee53878e004 100644 --- a/tests/basic/afr/granular-esh/granular-esh.t +++ b/tests/basic/afr/granular-esh/granular-esh.t @@ -149,10 +149,9 @@ TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$ROOT_GFID/dir TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$ROOT_GFID/newdir TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$ROOT_GFID/file_stale -# To be uncommented once index xl is made to purge the parent gfid dir on rm -rf -#TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$gfid_dir/f1 -#TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$gfid_dir/f2 -#TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$gfid_dir/f3 +TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$gfid_dir/f1 +TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$gfid_dir/f2 +TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$gfid_dir/f3 TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$gfid_newdir/f1 TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$gfid_newdir/f2 @@ -164,7 +163,6 @@ TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$gfid_newsubdir/f3 TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$ROOT_GFID TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$gfid_newdir TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$gfid_newsubdir -# To be uncommented once index xl is made to purge the parent gfid dir on rm -rf -#TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$gfid_dir +TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$gfid_dir cleanup -- cgit