diff options
author | Samikshan Bairagya <samikshan@gmail.com> | 2017-06-02 10:12:12 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2017-07-10 04:33:19 +0000 |
commit | 9e8ee31e643b7fbf7d46092c395ea27aaeb82f6b (patch) | |
tree | c48e28158aa31462bba580a8ef38e01ce1a5af6d /tests | |
parent | e304f48fa262e5cdbe181fb3fee5dfb9c893108c (diff) |
glusterd: Introduce option to limit no. of muxed bricks per process
This commit introduces a new global option that can be set to limit
the number of multiplexed bricks in one process.
Usage:
`# gluster volume set all cluster.max-bricks-per-process <value>`
If this option is not set then multiplexing will happen for now
with no limitations set; i.e. a brick process will have as many
bricks multiplexed to it as possible. In other words the current
multiplexing behaviour won't change if this option isn't set to
any value.
This commit also introduces a brick process instance that contains
information about brick processes, like the number of bricks
handled by the process (which is 1 in non-multiplexing cases), list
of bricks, and port number which also serves as an unique identifier
for each brick process instance. The brick process list is
maintained in 'glusterd_conf_t'.
Updates: #151
Change-Id: Ib987d14ab0a4f6034dac01b73a4b2839f7b0b695
Signed-off-by: Samikshan Bairagya <samikshan@gmail.com>
Reviewed-on: https://review.gluster.org/17469
Smoke: Gluster Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/basic/multiplex.t | 2 | ||||
-rw-r--r-- | tests/bugs/core/multiplex-limit-issue-151.t | 57 |
2 files changed, 59 insertions, 0 deletions
diff --git a/tests/basic/multiplex.t b/tests/basic/multiplex.t index ed8788ff3bb..2f0f462f14d 100644 --- a/tests/basic/multiplex.t +++ b/tests/basic/multiplex.t @@ -17,6 +17,8 @@ function count_brick_pids { | grep -v "N/A" | sort | uniq | wc -l } +cleanup + TEST glusterd TEST $CLI volume set all cluster.brick-multiplex on push_trapfunc "$CLI volume set all cluster.brick-multiplex off" diff --git a/tests/bugs/core/multiplex-limit-issue-151.t b/tests/bugs/core/multiplex-limit-issue-151.t new file mode 100644 index 00000000000..9511756ecde --- /dev/null +++ b/tests/bugs/core/multiplex-limit-issue-151.t @@ -0,0 +1,57 @@ +#!/bin/bash + +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../traps.rc +. $(dirname $0)/../../volume.rc + +function count_up_bricks { + $CLI --xml volume status all | grep '<status>1' | wc -l +} + +function count_brick_processes { + pgrep glusterfsd | wc -l +} + +function count_brick_pids { + $CLI --xml volume status all | sed -n '/.*<pid>\([^<]*\).*/s//\1/p' \ + | grep -v "N/A" | sort | uniq | wc -l +} + +cleanup; + +TEST glusterd + +TEST $CLI volume set all cluster.brick-multiplex on +TEST ! $CLI volume set all cluster.max-bricks-per-process -1 +TEST ! $CLI volume set all cluster.max-bricks-per-process foobar +TEST $CLI volume set all cluster.max-bricks-per-process 3 + +push_trapfunc "$CLI volume set all cluster.brick-multiplex off" +push_trapfunc "cleanup" + +TEST $CLI volume create $V0 $H0:$B0/brick{0..5} +TEST $CLI volume start $V0 + +EXPECT 2 count_brick_processes +EXPECT 2 count_brick_pids +EXPECT_WITHIN $PROCESS_UP_TIMEOUT 6 count_up_bricks + +pkill gluster +TEST glusterd + +EXPECT_WITHIN $PROCESS_UP_TIMEOUT 2 count_brick_processes +EXPECT_WITHIN $PROCESS_UP_TIMEOUT 2 count_brick_pids +EXPECT_WITHIN $PROCESS_UP_TIMEOUT 6 count_up_bricks + +TEST $CLI volume add-brick $V0 $H0:$B0/brick6 + +EXPECT_WITHIN $PROCESS_UP_TIMEOUT 3 count_brick_processes +EXPECT_WITHIN $PROCESS_UP_TIMEOUT 3 count_brick_pids +EXPECT_WITHIN $PROCESS_UP_TIMEOUT 7 count_up_bricks + +TEST $CLI volume remove-brick $V0 $H0:$B0/brick3 start +TEST $CLI volume remove-brick $V0 $H0:$B0/brick3 commit + +EXPECT_WITHIN $PROCESS_UP_TIMEOUT 3 count_brick_processes +EXPECT_WITHIN $PROCESS_UP_TIMEOUT 3 count_brick_pids +EXPECT_WITHIN $PROCESS_UP_TIMEOUT 6 count_up_bricks |