[Sheepdog] [PATCH 2/2] sheep: don't skip notify event
Liu Yuan
namei.unix at gmail.com
Sat Mar 31 10:55:41 CEST 2012
From: Liu Yuan <tailai.ly at taobao.com>
We need to handle notify event firstly because during shutdown operation,
in a large set of nodes, some nodes that are shut-down will be mistaken
as a leave events and broadcasts to other nodes where the notify of shutdown
is delayed, thus cause those nodes to perform recovery process improperly.
Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
sheep/group.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/sheep/group.c b/sheep/group.c
index a4ddc73..6aec105 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -1084,8 +1084,12 @@ do_retry:
struct request *req = container_of(cevent, struct request, cev);
struct sd_obj_req *hdr = (struct sd_obj_req *)&req->rq;
+ /* we need to handle notify event firstly
+ * since it may has shutdown cluster command or some nodes may
+ * take nodes that being shutdowned as left ones
+ */
if (cevent->ctype == CPG_EVENT_NOTIFY)
- continue;
+ break;
if (is_membership_change_event(cevent->ctype))
break;
--
1.7.8.2
More information about the sheepdog
mailing list