[sheepdog] [PATCH] sheep: don't start recovery for leave node

Liu Yuan namei.unix at gmail.com
Tue Mar 26 07:42:11 CET 2013


From: Liu Yuan <tailai.ly at taobao.com>

There is no sense for leave node (gateway only) to recover objects

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 sheep/group.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sheep/group.c b/sheep/group.c
index b2ea2bf..c5bdf1e 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -1178,6 +1178,10 @@ void sd_leave_handler(const struct sd_node *left, const struct sd_node *members,
 	if (sys->status == SD_STATUS_SHUTDOWN)
 		return;
 
+	if (node_is_local(left))
+		/* Mark leave node as gateway only node */
+		sys->this_node.nr_vnodes = 0;
+
 	old_vnode_info = current_vnode_info;
 	current_vnode_info = alloc_vnode_info(members, nr_members);
 
-- 
1.7.9.5




More information about the sheepdog mailing list