summaryrefslogtreecommitdiffstats
path: root/tests/basic
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2016-06-22 14:52:58 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-06-28 01:13:57 -0700
commit2ca5388692e70e079c99771d8c66a06bd90d5268 (patch)
treeda9ff1435f6ba04267537d25bebaa9f0a4f01f21 /tests/basic
parent888de8851e718d8e3117e47fa35cfc075b998f62 (diff)
downloadglusterfs-2ca5388692e70e079c99771d8c66a06bd90d5268.tar.gz
glusterfs-2ca5388692e70e079c99771d8c66a06bd90d5268.tar.xz
glusterfs-2ca5388692e70e079c99771d8c66a06bd90d5268.zip
features/index: Delete parent dir indices when heal on it is complete
In this patch, the state information about whether a directory gfid index is present or not is stored in the inode ctx with values IN and NOTIN. This saves index xl the need to perform stat() everytime an index_entry_create() is called. When a brick is restarted these in-memory inode ctx records will be gone. So when granular entry heal happens after a brick is restarted, and a post-op is done on the parent, if the state gotten from inode ctx is UNKNOWN, then index xl does a stat to initialize the state as IN or NOTIN. Note that this is a one-time operation for the lifetime of the brick. Such a change also helps avoid calling index_del() in xattrop_index_action() periodically even when granular self-heal is disabled or when the volume type is disperse. Change-Id: Ib92c17350e6531b91ab81477410fe1e7a5856207 BUG: 1331323 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/14781 Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'tests/basic')
-rw-r--r--tests/basic/afr/granular-esh/conservative-merge.t17
-rw-r--r--tests/basic/afr/granular-esh/granular-esh.t17
2 files changed, 17 insertions, 17 deletions
diff --git a/tests/basic/afr/granular-esh/conservative-merge.t b/tests/basic/afr/granular-esh/conservative-merge.t
index 194c0fcc2d..b566a0ea4d 100644
--- a/tests/basic/afr/granular-esh/conservative-merge.t
+++ b/tests/basic/afr/granular-esh/conservative-merge.t
@@ -126,14 +126,13 @@ TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$gfid_subdir/f1
TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$gfid_dir3/f1
TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$gfid_subdir2/f1
-# To be uncommented once index xl is made to purge the parent gfid dir
-#TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$ROOT_GFID
-#TEST ! stat $B0/${V0}0/.glusterfs/indices/entry-changes/$ROOT_GFID
-#TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$gfid_dir
-#TEST ! stat $B0/${V0}0/.glusterfs/indices/entry-changes/$gfid_dir
-#TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$gfid_dir2
-#TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$gfid_subdir
-#TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$gfid_dir3
-#TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$gfid_subdir2
+TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$ROOT_GFID
+TEST ! stat $B0/${V0}0/.glusterfs/indices/entry-changes/$ROOT_GFID
+TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$gfid_dir
+TEST ! stat $B0/${V0}0/.glusterfs/indices/entry-changes/$gfid_dir
+TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$gfid_dir2
+TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$gfid_subdir
+TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$gfid_dir3
+TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$gfid_subdir2
cleanup
diff --git a/tests/basic/afr/granular-esh/granular-esh.t b/tests/basic/afr/granular-esh/granular-esh.t
index 9aa4505a3c..4adcfc7456 100644
--- a/tests/basic/afr/granular-esh/granular-esh.t
+++ b/tests/basic/afr/granular-esh/granular-esh.t
@@ -149,9 +149,10 @@ 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
-TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changesi/$gfid_dir/f1
-TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changesi/$gfid_dir/f2
-TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changesi/$gfid_dir/f3
+# 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_newdir/f1
TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$gfid_newdir/f2
@@ -160,10 +161,10 @@ TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$gfid_newsubdir/f1
TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$gfid_newsubdir/f2
TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$gfid_newsubdir/f3
-# To be uncommented once index xl is made to purge the parent gfid dir
-# 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/$newsubdir
-# TEST ! stat $B0/${V0}1/.glusterfs/indices/entry-changes/$dir
+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
cleanup