[sheepdog] [PATCH v2 04/11] sheep: don't check nodes information for joined nodes

Liu Yuan namei.unix at gmail.com
Sat Sep 14 12:34:24 CEST 2013


cluster_join_check is basically used to check newly joining node. But the old
code also check the nodes states passed by cinfo with sys->cinfo. After we have
struct rb_node rb in the sd_node, we'll never have this check passed.

Instead of doing the check with more complex code, this patch simply remove the
check since nodes states in the joined nodes are always the same.

Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
 sheep/group.c |    9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/sheep/group.c b/sheep/group.c
index e721a96..eee8385 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -846,13 +846,6 @@ static bool cluster_join_check(const struct cluster_info *cinfo)
 	if (!cluster_ctime_check(cinfo))
 		return false;
 
-	if (cinfo->epoch == sys->cinfo.epoch &&
-	    memcmp(cinfo->nodes, sys->cinfo.nodes,
-		   sizeof(cinfo->nodes[0]) * cinfo->nr_nodes) != 0) {
-		sd_alert("epoch log entries does not match");
-		return false;
-	}
-
 	return true;
 }
 
@@ -863,7 +856,7 @@ main_fn void sd_accept_handler(const struct sd_node *joined,
 	int i;
 	const struct cluster_info *cinfo = opaque;
 
-	if (!cluster_join_check(cinfo)) {
+	if (node_is_local(joined) && !cluster_join_check(cinfo)) {
 		sd_err("failed to join Sheepdog");
 		exit(1);
 	}
-- 
1.7.9.5




More information about the sheepdog mailing list