From 21c7f7baccfaf644805e63682e5a7d2a9864a1e6 Mon Sep 17 00:00:00 2001 From: Mohit Agrawal Date: Mon, 8 May 2017 19:29:22 +0530 Subject: glusterd: socketfile & pidfile related fixes for brick multiplexing feature Problem: While brick-muliplexing is on after restarting glusterd, CLI is not showing pid of all brick processes in all volumes. Solution: While brick-mux is on all local brick process communicated through one UNIX socket but as per current code (glusterd_brick_start) it is trying to communicate with separate UNIX socket for each volume which is populated based on brick-name and vol-name.Because of multiplexing design only one UNIX socket is opened so it is throwing poller error and not able to fetch correct status of brick process through cli process. To resolve the problem write a new function glusterd_set_socket_filepath_for_mux that will call by glusterd_brick_start to validate about the existence of socketpath. To avoid the continuous EPOLLERR erros in logs update socket_connect code. Test: To reproduce the issue followed below steps 1) Create two distributed volumes(dist1 and dist2) 2) Set cluster.brick-multiplex is on 3) kill glusterd 4) run command gluster v status After apply the patch it shows correct pid for all volumes BUG: 1444596 Change-Id: I5d10af69dea0d0ca19511f43870f34295a54a4d2 Signed-off-by: Mohit Agrawal Reviewed-on: https://review.gluster.org/17101 Smoke: Gluster Build System Reviewed-by: Prashanth Pai NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Atin Mukherjee --- xlators/mgmt/glusterd/src/glusterd-brick-ops.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-brick-ops.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c index 0a7e7581cd5..b1b13a49f71 100644 --- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c @@ -1960,6 +1960,7 @@ glusterd_remove_brick_validate_bricks (gf1_op_commands cmd, int32_t brick_count, int ret = -1; char pidfile[PATH_MAX+1] = {0,}; glusterd_conf_t *priv = THIS->private; + int pid = -1; /* Check whether all the nodes of the bricks to be removed are * up, if not fail the operation */ @@ -2048,12 +2049,14 @@ check: } GLUSTERD_GET_BRICK_PIDFILE (pidfile, volinfo, brickinfo, priv); - if (!gf_is_service_running (pidfile, NULL)) { + if (!gf_is_service_running (pidfile, &pid)) { snprintf (msg, sizeof (msg), "Found dead " "brick %s", brick); *errstr = gf_strdup (msg); ret = -1; goto out; + } else { + ret = 0; } continue; } -- cgit