From 72d9e7144855b56e23c7a1f160eb5bb956287eaa Mon Sep 17 00:00:00 2001 From: Richard Wareing Date: Thu, 10 Dec 2015 22:27:27 -0800 Subject: cluster/afr: Fix case in PGFID healing where NOOP was not being honored Summary: - PGFID healing should not be triggered in the case where there is nothing to do (ret = 2). Instead this return code should be returned to the heal daemon to trigger the reap of the entry. - Reworked shd-pgfid-heal.t to queue up heal naturally instead of synthetically Test Plan: - Run tests/basic/afr/shd-pgfid-heal.t Differential Revision: https://phabricator.fb.com/D2748578 Change-Id: I74300de2b4dce23867f4111548de35f58bf77453 Signed-off-by: Jeff Darcy Reviewed-on: https://review.gluster.org/17936 Smoke: Gluster Build System Tested-by: Jeff Darcy CentOS-regression: Gluster Build System Reviewed-by: Jeff Darcy --- tests/basic/afr/shd-pgfid-heal.t | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/basic') diff --git a/tests/basic/afr/shd-pgfid-heal.t b/tests/basic/afr/shd-pgfid-heal.t index d12d29e13ba..6213e4c6374 100644 --- a/tests/basic/afr/shd-pgfid-heal.t +++ b/tests/basic/afr/shd-pgfid-heal.t @@ -17,6 +17,7 @@ TEST $CLI volume set $V0 nfs.disable on TEST $CLI volume set $V0 cluster.quorum-type none #EST $CLI volume set $V0 cluster.favorite-child-by-majority on #EST $CLI volume set $V0 cluster.favorite-child-by-mtime on +TEST $CLI volume set $V0 cluster.pgfid-self-heal on TEST $CLI volume set $V0 cluster.favorite-child-policy majority TEST $CLI volume set $V0 storage.build-pgfid on TEST $CLI volume set $V0 cluster.metadata-self-heal off @@ -31,13 +32,15 @@ TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 \ cd $M0 mkdir -p a/b/c dd if=/dev/urandom of=a/b/c/testfile bs=128k count=5 2>/dev/null -MD5=$(md5sum a/b/c/testfile | cut -d\ -f1) # Kill the SHD while we setup the test pkill -f gluster/glustershd # Kill the brick as well such that TEST kill_brick $V0 $H0 $B0/${V0}1 +echo stuff >> $M0/a/b/c/testfile +MD5=$(md5sum a/b/c/testfile | cut -d\ -f1) + # Grab the GFID of the file and parent dir GFID_PARENT_B_RAW=$(getfattr -n trusted.gfid -e hex $B0/${V0}1/a/b 2>/dev/null | grep trusted.gfid | cut -d= -f2) GFID_PARENT_B_FORMATTED=$(echo "$GFID_PARENT_B_RAW" | awk '{print substr($1,3,8)"-"substr($1,11,4)"-"substr($1,15,4)"-"substr($1,19,4)"-"substr($1,23,12)}') @@ -67,9 +70,6 @@ rm -f $GFID_PARENT_C_LINK_B1 rmdir $B0/${V0}1/a/b rm -f $GFID_PARENT_B_LINK_B1 -# Now manually queue up the parent directory for healing -touch $B0/${V0}3/.glusterfs/indices/xattrop/$GFID_FORMATTED - # Kick off the SHD and wait 30 seconds for healing to take place TEST gluster vol start patchy force EXPECT_WITHIN 30 "0" get_pending_heal_count $V0 -- cgit