From f18a3f30bbeaf3bb067b913082830d7f874555ca Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Thu, 5 Feb 2015 15:41:35 +0530 Subject: protocol/client: sequence CHILD_UP, CHILD_DOWN etc notifications ... from all bricks in the volume This patch is important in the context of MT epoll. With MT epoll, notification events from client xlators could reach cluster xlators like afr, dht, ec, stripe etc. in different orders. For e.g, In a distributed replicate volume of 2 bricks, namely Brick1 and Brick2, the following network events are observed by a mount process. - connection to Brick1 is broken. - connection to Brick1 has been restored. - connection to Brick2 is broken. - connection to Brick2 has been restored. Without establishing a total ordering of events, we can't guarantee that cluster xlators like afr, dht perceive them in the same order. While we would expect afr (say) to perceive it as only one of Brick1 and Brick2 going down at any given time, it is possible for the notification of Brick2 going offline to race with the notification of Brick1 coming back online. Change-Id: I78f5a52bfb05593335d0e9ad53ebfff98995593d BUG: 1104462 Signed-off-by: Krishnan Parthasarathi Reviewed-on: http://review.gluster.org/9591 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- glusterfsd/src/glusterfsd.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'glusterfsd') diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c index a46385aa292..c410ffd40d9 100644 --- a/glusterfsd/src/glusterfsd.c +++ b/glusterfsd/src/glusterfsd.c @@ -1394,6 +1394,8 @@ glusterfs_ctx_defaults_init (glusterfs_ctx_t *ctx) goto out; pthread_mutex_init (&(ctx->lock), NULL); + pthread_mutex_init (&ctx->notify_lock, NULL); + pthread_cond_init (&ctx->notify_cond, NULL); ctx->clienttable = gf_clienttable_alloc(); if (!ctx->clienttable) -- cgit