path: root/tests/volume.rc
diff options
authorAtin Mukherjee <>2017-06-01 22:05:51 +0530
committerJeff Darcy <>2017-06-06 02:24:28 +0000
commit7b58ec260152bdcf840ac622dbb883ce8b593f63 (patch)
treec63fefd2f4577ff6d4b7b34de3077b1730905b2c /tests/volume.rc
parentd7105ba1652e548d9ba893e05f3d1fa29e8ee3b1 (diff)
glusterd: fix brick start race
This commit tries to handle a race where we might end up trying to spawn the brick process twice with two different set of ports resulting into glusterd portmapper having the same brick entry in two different ports which will result into clients to fail connect to bricks because of incorrect ports been communicated back by glusterd. In glusterd_brick_start () checking brickinfo->status flag to identify whether a brick has been started by glusterd or not is not sufficient as there might be cases where while glusterd restarts glusterd_restart_bricks () will be called through glusterd_spawn_daemons () in synctask and immediately glusterd_do_volume_quorum_action () with server-side-quorum set to on will again try to start the brick and in case if the RPC_CLNT_CONNECT event for the same brick hasn't been processed by glusterd by that time, brickinfo->status will still be marked as GF_BRICK_STOPPED resulting into a reattempt to start the brick with a different port and that would result portmap go for a toss and resulting clients to fetch incorrect port. Fix would be to introduce another enum value called GF_BRICK_STARTING in brickinfo->status which will be set when a brick start is attempted by glusterd and will be set to started through RPC_CLNT_CONNECT event. For brick multiplexing, on attach brick request given the brickinfo->status flag is marked to started directly this value will not have any effect. Also this patch removes started_here flag as it looks to be redundant as brickinfo->status. Change-Id: I9dda1a9a531b67734a6e8c7619677867b520dcb2 BUG: 1457981 Signed-off-by: Atin Mukherjee <> Reviewed-on: Smoke: Gluster Build System <> NetBSD-regression: NetBSD Build System <> CentOS-regression: Gluster Build System <> Reviewed-by: Jeff Darcy <>
Diffstat (limited to 'tests/volume.rc')
1 files changed, 0 insertions, 5 deletions
diff --git a/tests/volume.rc b/tests/volume.rc
index 3aec6d4..94162cf 100644
--- a/tests/volume.rc
+++ b/tests/volume.rc
@@ -296,11 +296,6 @@ function kill_brick {
local socket=$(cat $cmdline | tr '\0' '\n' | grep '\.socket$')
gf_attach -d $socket $brick
- # Since we're not going through glusterd, we need to clean up the
- # pidfile ourselves. However, other state in glusterd (e.g.
- # started_here) won't be updated. A "stop-brick" CLI command would
- # sure be useful.
- rm -f $pidfile
# When the last brick in a process is terminated, the process has to
# sleep for a second to give the RPC response a chance to get back to