[sheepdog] [PATCH] recvoery: don't do recovery when it's a gateway only node

Liu Yuan namei.unix at gmail.com
Mon Jul 16 11:51:26 CEST 2012


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


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

diff --git a/sheep/recovery.c b/sheep/recovery.c
index 444e99f..dd17edd 100644
--- a/sheep/recovery.c
+++ b/sheep/recovery.c
@@ -584,10 +584,18 @@ out:
 	free(buf);
 }
 
+static inline bool node_is_gateway_only(void)
+{
+	return sys->this_node.nr_vnodes == 0 ? true : false;
+}
+
 int start_recovery(struct vnode_info *cur_vnodes, struct vnode_info *old_vnodes)
 {
 	struct recovery_work *rw;
 
+	if (node_is_gateway_only())
+		return 0;
+
 	rw = zalloc(sizeof(struct recovery_work));
 	if (!rw) {
 		eprintf("%m\n");
-- 
1.7.10.2




More information about the sheepdog mailing list