diff options
author | Atin Mukherjee <amukherj@redhat.com> | 2016-07-25 19:09:08 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2016-08-03 21:43:34 -0700 |
commit | c3dee6d35326c6495591eb5bbf7f52f64031e2c4 (patch) | |
tree | 7a57db6876b86434255068c41479066a0cf51caa /tests/bugs/glusterd | |
parent | ea6a1ebe931e49464eb17205b94f5c87765cf696 (diff) |
glusterd: clean up old port and allocate new one on every restart
GlusterD as of now was blindly assuming that the brick port which was already
allocated would be available to be reused and that assumption is absolutely
wrong.
Solution : On first attempt, we thought GlusterD should check if the already
allocated brick ports are free, if not allocate new port and pass it to the
daemon. But with that approach there is a possibility that if PMAP_SIGNOUT is
missed out, the stale port will be given back to the clients where connection
will keep on failing. Now given the port allocation always start from base_port,
if everytime a new port has to be allocated for the daemons, the port range will
still be under control. So this fix tries to clean up old port using
pmap_registry_remove () if any and then goes for pmap_registry_alloc ()
Change-Id: If54a055d01ab0cbc06589dc1191d8fc52eb2c84f
BUG: 1221623
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: http://review.gluster.org/15005
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Avra Sengupta <asengupt@redhat.com>
Diffstat (limited to 'tests/bugs/glusterd')
-rwxr-xr-x | tests/bugs/glusterd/1313628-import-brick-ports-always.t | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/tests/bugs/glusterd/1313628-import-brick-ports-always.t b/tests/bugs/glusterd/1313628-import-brick-ports-always.t deleted file mode 100755 index d04c4293466..00000000000 --- a/tests/bugs/glusterd/1313628-import-brick-ports-always.t +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../cluster.rc - -## Check that brick ports are always copied on import -## -------------------------------------------------- -## This test checks that the brick ports are copied on import by checking that -## they don't change when the following happens, -## - Stop a volume -## - Stop glusterd -## - Start the stopped volume -## - Start the stopped glusterd - -function get_brick_port() { - local VOL=$1 - local BRICK=$2 - $CLI2 volume status $VOL $BRICK --xml | sed -ne 's/.*<port>\([0-9]*\)<\/port>/\1/p' -} - - -cleanup - -TEST launch_cluster 2 -TEST $CLI1 peer probe $H2 -EXPECT_WITHIN $PROBE_TIMEOUT 1 peer_count - -# Create and start volume so that brick port assignment happens -TEST $CLI1 volume create $V0 $H1:$B1/$V0 $H2:$B2/$V0 -TEST $CLI1 volume start $V0 - -# Save port for 2nd brick -BPORT_ORIG=$(get_brick_port $V0 $H2:$B2/$V0) - -# Stop volume, stop 2nd glusterd, start volume, start 2nd glusterd -TEST $CLI1 volume stop $V0 -TEST kill_glusterd 2 - -TEST $CLI1 volume start $V0 -TEST start_glusterd 2 -EXPECT_WITHIN $PROBE_TIMEOUT 1 peer_count - -# Get new port and compare with old one -EXPECT_WITHIN $PROCESS_UP_TIMEOUT $BPORT_ORIG get_brick_port $V0 $H2:$B2/$V0 - -$CLI1 volume stop $V0 - -cleanup |