summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Wareing <rwareing@fb.com>2015-12-03 12:36:20 -0800
committerJeff Darcy <jeff@pl.atyp.us>2017-09-11 15:50:22 +0000
commit20ca645344e4af89a53b8d304063a6dd6dc5100a (patch)
tree27d3459460e58a9a3f1b3ff303fd780840db82a7
parent4d8268d7602979795972d976dab4959d5e0db55b (diff)
clusters/afr: Move root entry heal flow to SHD
Summary: - Improves upon D2387001 by moving the "forced" root gfid heal to the SHDs - Removed code which forced NFSd/FUSE clients through the entry heal for the root GFID, this will make them spin up just as fast as prior to D2387001 (i.e. instantly) Porting note: mostly inapplicable in 3.8, only one non-test change survived Test Plan: - Must pass tests/bugs/fb8149516.t Reviewers: dph, moox, sshreyas Reviewed By: sshreyas Differential Revision: https://phabricator.fb.com/D2722239 Change-Id: I35f5827df6ead1bb0ff886ca0adabb2add2e7163 Signed-off-by: Jeff Darcy <jdarcy@fb.com> Reviewed-on: https://review.gluster.org/18259 Reviewed-by: Jeff Darcy <jeff@pl.atyp.us> Tested-by: Jeff Darcy <jeff@pl.atyp.us> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org>
-rw-r--r--tests/bugs/fb8149516.t12
-rw-r--r--xlators/cluster/afr/src/afr-common.c4
2 files changed, 10 insertions, 6 deletions
diff --git a/tests/bugs/fb8149516.t b/tests/bugs/fb8149516.t
index 3679ab8f93a..e7f87ba29aa 100644
--- a/tests/bugs/fb8149516.t
+++ b/tests/bugs/fb8149516.t
@@ -10,40 +10,44 @@ TEST pidof glusterd
TEST $CLI volume create $V0 replica 3 $H0:$B0/${V0}{0,1,2}
TEST $CLI volume set $V0 cluster.read-subvolume-index 2
TEST $CLI volume set $V0 cluster.background-self-heal-count 0
-TEST $CLI volume set $V0 cluster.heal-timeout 30
+TEST $CLI volume set $V0 cluster.heal-timeout 20
TEST $CLI volume set $V0 cluster.choose-local off
TEST $CLI volume set $V0 cluster.entry-self-heal off
TEST $CLI volume set $V0 cluster.data-self-heal off
TEST $CLI volume set $V0 cluster.metadata-self-heal off
+TEST $CLI volume set $V0 cluster.shd-max-threads 1
TEST $CLI volume set $V0 nfs.disable off
TEST $CLI volume set $V0 nfs.write-size 524288
TEST $CLI volume set $V0 nfs.read-size 524288
TEST $CLI volume start $V0
TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --attribute-timeout=0 --entry-timeout=0
+mkdir $M0/dir
cd $M0
for i in {1..10}
do
dd if=/dev/urandom of=testfile$i bs=1M count=1 2>/dev/null
+ dd if=/dev/urandom of=dir/testfile$i bs=1M count=1 2>/dev/null
done
cd ~
TEST kill_brick $V0 $H0 $B0/${V0}2
TEST rm -rf $B0/${V0}2/testfile*
+TEST rm -rf $B0/${V0}2/dir
TEST rm -rf $B0/${V0}2/.glusterfs
TEST $CLI volume stop $V0
sleep 5
TEST $CLI volume start $V0
EXPECT_WITHIN 20 "1" afr_child_up_status_in_shd $V0 2
-EXPECT_WITHIN 30 "0" get_pending_heal_count $V0
+EXPECT_WITHIN 90 "0" get_pending_heal_count $V0
# Verify we see all ten files when ls'ing, without the patch this should
# return no files and fail.
how_many_files () {
- \ls $M0 2> /dev/null | wc -l
+ find $M0 -type f 2> /dev/null | wc -l
}
# Once it's triggered, entry self-heal happens asynchronously and might take
# a long-ish time before the missing entries appear, but it does complete.
# To accommodate that, retry for a little while.
-EXPECT_WITHIN 20 "10" how_many_files
+EXPECT_WITHIN 20 "20" how_many_files
cleanup
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index c7657dd5a9f..7425b6688f2 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -1086,7 +1086,7 @@ int
afr_inode_refresh_done (call_frame_t *frame, xlator_t *this, int error)
{
afr_private_t *priv = NULL;
- call_frame_t *heal_frame = NULL;
+ call_frame_t *heal_frame = NULL;
afr_local_t *local = NULL;
gf_boolean_t start_heal = _gf_false;
afr_local_t *heal_local = NULL;
@@ -1108,7 +1108,7 @@ afr_inode_refresh_done (call_frame_t *frame, xlator_t *this, int error)
err = afr_inode_refresh_err (frame, this);
if ((ret && afr_selfheal_enabled (this)) ||
- (!priv->shd.iamshd && (priv->did_discovery == _gf_false) &&
+ (priv->shd.iamshd &&
AFR_IS_ROOT_GFID (local->refreshinode->gfid))) {
heal_frame = copy_frame (frame);
if (!heal_frame)