diff options
author | Susant Palai <spalai@redhat.com> | 2015-05-04 16:43:02 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2015-05-07 10:26:54 -0700 |
commit | 04a72476789d06c0e55b73f953ff1ad68739ebd4 (patch) | |
tree | f9a79337f1a133d6cbcffe5a6a444412197a5990 /tests | |
parent | 641e91fa83ae70514745d55728e1e32a740c2401 (diff) |
dht/rebalance: Throttle rebalance
Throttle value will be "normal" by default. For throttling down,
a thread will be put in to sleep. And for throttling up,
gf_defrag_process_dir will wake up the sleeping threads.
Change-Id: I4892ab14982a1ff305aeb2d8bbd33c79d6877b69
BUG: 1219579
Signed-off-by: Susant Palai <spalai@redhat.com>
Reviewed-on: http://review.gluster.org/10526
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
Reviewed-on: http://review.gluster.org/10629
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/basic/distribute/throttle-rebal.t | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/basic/distribute/throttle-rebal.t b/tests/basic/distribute/throttle-rebal.t new file mode 100644 index 00000000000..89495aee71b --- /dev/null +++ b/tests/basic/distribute/throttle-rebal.t @@ -0,0 +1,42 @@ +#!/bin/bash +# Test to check +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../volume.rc + +#Check rebal-throttle set option sanity +cleanup; + +TEST glusterd +TEST pidof glusterd +TEST $CLI volume create $V0 $H0:$B0/brick1 $H0:$B0/brick2 +TEST $CLI volume start $V0 + +function set_throttle { + local level=$1 + $CLI volume set $V0 cluster.rebal-throttle $level 2>&1 |grep -oE 'success|failed' +} + + +THROTTLE_LEVEL="lazy" +EXPECT "success" set_throttle $THROTTLE_LEVEL +EXPECT "$THROTTLE_LEVEL" echo `$CLI volume info | grep rebal-throttle | awk '{print $2}'` + +THROTTLE_LEVEL="normal" +EXPECT "success" set_throttle $THROTTLE_LEVEL +EXPECT "$THROTTLE_LEVEL" echo `$CLI volume info | grep rebal-throttle | awk '{print $2}'` + + +THROTTLE_LEVEL="aggressive" +EXPECT "success" set_throttle $THROTTLE_LEVEL +EXPECT "$THROTTLE_LEVEL" echo `$CLI volume info | grep rebal-throttle | awk '{print $2}'` + +THROTTLE_LEVEL="garbage" +EXPECT "failed" set_throttle $THROTTLE_LEVEL + +#check if throttle-level is still aggressive +EXPECT "aggressive" echo `$CLI volume info | grep rebal-throttle | awk '{print $2}'` + +TEST $CLI volume stop $V0; +TEST $CLI volume delete $V0; + +cleanup; |