From 4a5d8f65b9b04385dcae8b16a650f4e8ed357f8b Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Tue, 22 Mar 2016 14:26:32 +0530 Subject: afr: Add throttled background client-side heals Backport of: http://review.gluster.org/13207 If a heal is needed after inode refresh (lookup, read_txn), launch it in the background instead of blocking the fop (that triggered refresh) until the heal happens. afr_replies_interpret() is modified such that the heal is launched only if atleast one sink brick is up. Max. no of heals that can happen in parallel is configurable via the 'background-self-heal-count' volume option. Any number greater than that is put in a wait queue whose length is configurable via 'heal-wait-queue-leng' volume option. If the wait queue is also full, further heals will be ignored. Default values: background-self-heal-count=8, heal-wait-queue-leng=128 Change-Id: I9a134b2c29d66b70b7b1278811bd504963aabacc BUG: 1313312 Signed-off-by: Ravishankar N Reviewed-on: http://review.gluster.org/13564 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Pranith Kumar Karampuri --- tests/bugs/glusterd/859927/repl.t | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests/bugs/glusterd') diff --git a/tests/bugs/glusterd/859927/repl.t b/tests/bugs/glusterd/859927/repl.t index a500961165c..40e86029685 100755 --- a/tests/bugs/glusterd/859927/repl.t +++ b/tests/bugs/glusterd/859927/repl.t @@ -23,7 +23,6 @@ TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{1,2}; TEST $CLI volume set $V0 cluster.self-heal-daemon off TEST $CLI volume set $V0 performance.stat-prefetch off TEST $CLI volume set $V0 client-log-level DEBUG -TEST $CLI volume set $V0 cluster.background-self-heal-count 0 TEST $CLI volume start $V0 TEST glusterfs --entry-timeout=0 --attribute-timeout=0 -s $H0 --volfile-id=$V0 $M0; @@ -34,6 +33,7 @@ EXPECT full volume_option $V0 cluster.data-self-heal-algorithm create_setup_for_self_heal $M0/a EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status $V0 0 cat $file 2>&1 > /dev/null +EXPECT_WITHIN $HEAL_TIMEOUT 0 get_pending_heal_count $V0 TEST cmp $B0/${V0}1/a $B0/${V0}2/a TEST $CLI volume set $V0 cluster.data-self-heal-algorithm diff @@ -41,12 +41,14 @@ EXPECT diff volume_option $V0 cluster.data-self-heal-algorithm create_setup_for_self_heal $M0/a EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status $V0 0 cat $file 2>&1 > /dev/null +EXPECT_WITHIN $HEAL_TIMEOUT 0 get_pending_heal_count $V0 TEST cmp $B0/${V0}1/a $B0/${V0}2/a TEST $CLI volume reset $V0 cluster.data-self-heal-algorithm create_setup_for_self_heal $M0/a EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status $V0 0 cat $file 2>&1 > /dev/null +EXPECT_WITHIN $HEAL_TIMEOUT 0 get_pending_heal_count $V0 TEST cmp $B0/${V0}1/a $B0/${V0}2/a TEST ! $CLI volume set $V0 cluster.data-self-heal-algorithm "" -- cgit