|
|
d1681e |
From f5326dd5cfd3c2fae01bc62aa6e0725b501faa3a Mon Sep 17 00:00:00 2001
|
|
|
d1681e |
From: Atin Mukherjee <amukherj@redhat.com>
|
|
|
d1681e |
Date: Sun, 1 Apr 2018 22:10:30 +0530
|
|
|
d1681e |
Subject: [PATCH 311/325] glusterd: show brick online after port registration
|
|
|
d1681e |
|
|
|
d1681e |
Upstream-patch: https://review.gluster.org/19804
|
|
|
d1681e |
|
|
|
d1681e |
gluster-block project needs a dependency check to see if all the bricks
|
|
|
d1681e |
are online before bringing up the relevant gluster-block services. While
|
|
|
d1681e |
the patch https://review.gluster.org/#/c/19785/ attempts to write the
|
|
|
d1681e |
script but brick should be only marked as online only when the
|
|
|
d1681e |
pmap_signin is completed.
|
|
|
d1681e |
|
|
|
d1681e |
While this is perfectly fine for non brick multiplexing, but with brick
|
|
|
d1681e |
multiplexing this patch still doesn't eliminate the race completely as
|
|
|
d1681e |
the attach_req call is asynchrnous and glusterd immediately marks the
|
|
|
d1681e |
port as registerd.
|
|
|
d1681e |
|
|
|
d1681e |
>Fixes: bz#1563273
|
|
|
d1681e |
BUG: 1598356
|
|
|
d1681e |
Change-Id: I81db54b88f7315e1b24e0234beebe00de6429f9d
|
|
|
d1681e |
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
d1681e |
Reviewed-on: https://code.engineering.redhat.com/gerrit/143591
|
|
|
d1681e |
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
|
|
d1681e |
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
|
|
d1681e |
---
|
|
|
d1681e |
xlators/mgmt/glusterd/src/glusterd-utils.c | 5 +++--
|
|
|
d1681e |
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
d1681e |
|
|
|
d1681e |
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
|
|
|
d1681e |
index 5e9213c..e08c053 100644
|
|
|
d1681e |
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
|
|
|
d1681e |
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
|
|
|
d1681e |
@@ -5967,6 +5967,7 @@ glusterd_brick_start (glusterd_volinfo_t *volinfo,
|
|
|
d1681e |
(void) pmap_registry_bind (this,
|
|
|
d1681e |
brickinfo->port, brickinfo->path,
|
|
|
d1681e |
GF_PMAP_PORT_BRICKSERVER, NULL);
|
|
|
d1681e |
+ brickinfo->port_registered = _gf_true;
|
|
|
d1681e |
/*
|
|
|
d1681e |
* This will unfortunately result in a separate RPC
|
|
|
d1681e |
* connection per brick, even though they're all in
|
|
|
d1681e |
@@ -5976,7 +5977,6 @@ glusterd_brick_start (glusterd_volinfo_t *volinfo,
|
|
|
d1681e |
* TBD: re-use RPC connection across bricks
|
|
|
d1681e |
*/
|
|
|
d1681e |
if (is_brick_mx_enabled ()) {
|
|
|
d1681e |
- brickinfo->port_registered = _gf_true;
|
|
|
d1681e |
ret = glusterd_get_sock_from_brick_pid (pid, socketpath,
|
|
|
d1681e |
sizeof(socketpath));
|
|
|
d1681e |
if (ret) {
|
|
|
d1681e |
@@ -7083,7 +7083,8 @@ glusterd_add_brick_to_dict (glusterd_volinfo_t *volinfo,
|
|
|
d1681e |
GLUSTERD_GET_BRICK_PIDFILE (pidfile, volinfo, brickinfo, priv);
|
|
|
d1681e |
|
|
|
d1681e |
if (glusterd_is_brick_started (brickinfo)) {
|
|
|
d1681e |
- if (gf_is_service_running (pidfile, &pid)) {
|
|
|
d1681e |
+ if (gf_is_service_running (pidfile, &pid) &&
|
|
|
d1681e |
+ brickinfo->port_registered) {
|
|
|
d1681e |
brick_online = _gf_true;
|
|
|
d1681e |
} else {
|
|
|
d1681e |
pid = -1;
|
|
|
d1681e |
--
|
|
|
d1681e |
1.8.3.1
|
|
|
d1681e |
|