summaryrefslogtreecommitdiffstats
path: root/tests/afr.rc
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2015-05-25 16:42:50 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2015-05-26 08:12:50 -0700
commit158b047f7949d4fd1682fcb8f0722ddb28785bfa (patch)
tree811749cae43cdb92947e2788548215d03c3b7571 /tests/afr.rc
parentf59a1431e38ad644b6bdd4adbdf94ff028c9c60d (diff)
tests: Fix entry-self-heal.t
Because both bricks in the replica pair of patchy are in the same node, both full healer threads within the same shd try and fail to acquire non-blocking locks when each one gets lock on one of the bricks, causing heal to fail occasionally. Now heals are triggered from the mount as part of inode refresh. And because the AFR on the mount graph a. does not treat presence of dirty xattrs as something that needs a heal (this is true for dirs fool_heal and fool_me) and b. does not recursively heal the entire hierarchy of subdirs and their entries in one shot (this is true with source_creations_heal/dir1), index heal is used to heal fool_heal, fool_me and source_creations_heal/dir1 wherein only one brick (which is the brick that contains the good copy of source_creations_heal/dir_1: brick-1) has all the gfids to be healed copied into its indices/xattrop directory. Change-Id: I46df4188f16d1623f20cc0d7266b3afaeca6c31f BUG: 1163543 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/10916 Tested-by: NetBSD Build System Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'tests/afr.rc')
-rw-r--r--tests/afr.rc14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/afr.rc b/tests/afr.rc
index 2aae292..ed376f0 100644
--- a/tests/afr.rc
+++ b/tests/afr.rc
@@ -1,5 +1,19 @@
#!/bin/bash
+function create_brick_xattrop_entry {
+ local xattrop_dir=$(afr_get_index_path $1)
+ local base_entry=`ls $xattrop_dir`
+ local gfid_str
+ local params=`echo "$@" | cut -d' ' -f2-`
+ echo $params
+
+ for file in $params
+ do
+ gfid_str=$(gf_gfid_xattr_to_str $(gf_get_gfid_xattr $1/$file))
+ ln $xattrop_dir/$base_entry $xattrop_dir/$gfid_str
+ done
+}
+
function diff_dirs {
diff <(ls $1 | sort) <(ls $2 | sort)
}