From 30e0b86aae00430823f2523c6efa3c4ebbf0a478 Mon Sep 17 00:00:00 2001 From: Atin Mukherjee Date: Tue, 17 Oct 2017 21:32:44 +0530 Subject: glusterd: clean up portmap on brick disconnect GlusterD's portmap entry for a brick is cleaned up when a PMAP_SIGNOUT event is initiated by the brick process at the shutdown. But if the brick process crashes or gets killed through SIGKILL then this event is not initiated and glusterd ends up with a stale port. Since GlusterD's portmap traversal happens both ways, forward for allocation and backward for registry search, there is a possibility that glusterd might end up running with a stale port for a brick which eventually will end up with clients to fail to connect to the bricks. Solution is to clean up the port entry in case the process is down as part of the brick disconnect event. Although with this the handling PMAP_SIGNOUT event becomes redundant in most of the cases, but this is the safeguard method to avoid glusterd getting into the stale port issues. Change-Id: I04c5be6d11e772ee4de16caf56dbb37d5c944303 BUG: 1503246 Signed-off-by: Atin Mukherjee --- xlators/mgmt/glusterd/src/glusterd-pmap.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-pmap.h') diff --git a/xlators/mgmt/glusterd/src/glusterd-pmap.h b/xlators/mgmt/glusterd/src/glusterd-pmap.h index c0475db539e..f642d66ea38 100644 --- a/xlators/mgmt/glusterd/src/glusterd-pmap.h +++ b/xlators/mgmt/glusterd/src/glusterd-pmap.h @@ -43,7 +43,8 @@ int pmap_registry_bind (xlator_t *this, int port, const char *brickname, gf_pmap_port_type_t type, void *xprt); int pmap_registry_extend (xlator_t *this, int port, const char *brickname); int pmap_registry_remove (xlator_t *this, int port, const char *brickname, - gf_pmap_port_type_t type, void *xprt); + gf_pmap_port_type_t type, void *xprt, + gf_boolean_t brick_disconnect); int pmap_registry_search (xlator_t *this, const char *brickname, gf_pmap_port_type_t type, gf_boolean_t destroy); struct pmap_registry *pmap_registry_get (xlator_t *this); -- cgit