From 660ca23dee3a0f1a7128d3777589467b27af514b Mon Sep 17 00:00:00 2001 From: Ashish Pandey Date: Mon, 22 Aug 2016 16:03:13 +0530 Subject: cluster/ec: set/unset dirty flag for data/metadata update Currently, for all the update operations, metadata or data, we set the dirty flag at the end of the operation only if a brick is down. This leads to delay in healing and in some cases not at all. In this patch we set (+1) the dirty flag at the start of the metadata or data update operations and after successfull completion of the fop, we unset (-1) it again. Change-Id: Ide5668bdec7b937a61c5c840cdc79a967598e1e9 BUG: 1316873 Signed-off-by: Ashish Pandey Reviewed-on: http://review.gluster.org/13733 Tested-by: Pranith Kumar Karampuri Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Xavier Hernandez --- tests/basic/ec/ec-background-heals.t | 1 + tests/basic/ec/ec-new-entry.t | 14 ++++++++++++++ 2 files changed, 15 insertions(+) (limited to 'tests/basic') diff --git a/tests/basic/ec/ec-background-heals.t b/tests/basic/ec/ec-background-heals.t index 726e60d8fea..7ac6c0efc12 100644 --- a/tests/basic/ec/ec-background-heals.t +++ b/tests/basic/ec/ec-background-heals.t @@ -23,6 +23,7 @@ EXPECT_WITHIN $CHILD_UP_TIMEOUT "3" ec_child_up_count $V0 0 EXPECT_WITHIN $CONFIG_UPDATE_TIMEOUT "0" mount_get_option_value $M0 $V0-disperse-0 background-heals EXPECT_WITHIN $CONFIG_UPDATE_TIMEOUT "0" mount_get_option_value $M0 $V0-disperse-0 heal-wait-qlength TEST touch $M0/a +EXPECT_WITHIN $CHILD_UP_TIMEOUT "0" get_pending_heal_count $V0 #One for each active brick TEST kill_brick $V0 $H0 $B0/${V0}2 echo abc > $M0/a EXPECT 2 get_pending_heal_count $V0 #One for each active brick diff --git a/tests/basic/ec/ec-new-entry.t b/tests/basic/ec/ec-new-entry.t index 3a5c2ee11ec..2ba2bf5e16c 100644 --- a/tests/basic/ec/ec-new-entry.t +++ b/tests/basic/ec/ec-new-entry.t @@ -12,6 +12,17 @@ function get_md5sum { md5sum $1 | awk '{print $1}' } +#after replace-brick immediately trusted.ec.version will be absent, so if it +#is present we can assume that heal attempted on root +function root_heal_attempted { + if [ -z $(get_hex_xattr trusted.ec.version $1) ]; + then + echo "N"; + else + echo "Y"; + fi +} + TEST glusterd TEST pidof glusterd TEST $CLI volume create $V0 disperse 6 redundancy 2 $H0:$B0/${V0}{0..5} @@ -23,6 +34,9 @@ touch $M0/11 for i in {1..10}; do dd if=/dev/zero of=$M0/$i bs=1M count=1; done TEST $CLI volume replace-brick $V0 $H0:$B0/${V0}5 $H0:$B0/${V0}6 commit force EXPECT_WITHIN $CHILD_UP_TIMEOUT "6" ec_child_up_count $V0 0 +EXPECT_WITHIN $PROCESS_UP_TIMEOUT "Y" glustershd_up_status +EXPECT_WITHIN $CHILD_UP_TIMEOUT "6" ec_child_up_count_shd $V0 0 +EXPECT_WITHIN $HEAL_TIMEOUT "Y" root_heal_attempted $B0/${V0}6 EXPECT_WITHIN $HEAL_TIMEOUT "^0$" get_pending_heal_count $V0 #ls -l gives "Total" line so number of lines will be 1 more EXPECT "^12$" num_entries $B0/${V0}6 -- cgit