[sheepdog] [PATCH v2 8/9] sheep: remove finish_join from system_info

MORITA Kazutaka morita.kazutaka at gmail.com
Fri Jul 12 22:25:58 CEST 2013


From: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>

It is obvious that the sheep finishes a join phase when
update_cluster_info() is called against itself.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 sheep/group.c      |    9 +++------
 sheep/sheep_priv.h |    2 --
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/sheep/group.c b/sheep/group.c
index d86edc5..238c884 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -625,8 +625,6 @@ static void finish_join(const struct join_message *msg,
 			const struct sd_node *joined,
 			const struct sd_node *nodes, size_t nr_nodes)
 {
-	sys->join_finished = true;
-
 	sockfd_cache_add_group(nodes, nr_nodes);
 }
 
@@ -694,13 +692,13 @@ static void update_cluster_info(const struct join_message *msg,
 {
 	struct vnode_info *old_vnode_info;
 
-	sd_dprintf("status = %d, epoch = %d, finished: %d",
-		   msg->cluster_status, msg->cinfo.epoch, sys->join_finished);
+	sd_dprintf("status = %d, epoch = %d", msg->cluster_status,
+		   msg->cinfo.epoch);
 
 	if (!sys->gateway_only)
 		setup_backend_store(msg);
 
-	if (!sys->join_finished)
+	if (node_is_local(joined))
 		finish_join(msg, joined, nodes, nr_nodes);
 
 	old_vnode_info = main_thread_get(current_vnode_info);
@@ -960,7 +958,6 @@ static void requeue_cluster_request(void)
 int sd_reconnect_handler(void)
 {
 	sys->status = SD_STATUS_WAIT;
-	sys->join_finished = false;
 	if (sys->cdrv->init(sys->cdrv_option) != 0)
 		return -1;
 	if (send_join_request(&sys->this_node) != 0)
diff --git a/sheep/sheep_priv.h b/sheep/sheep_priv.h
index 4cd30ee..ab7778b 100644
--- a/sheep/sheep_priv.h
+++ b/sheep/sheep_priv.h
@@ -91,8 +91,6 @@ struct system_info {
 	struct cluster_driver *cdrv;
 	const char *cdrv_option;
 
-	/* set after finishing the JOIN procedure */
-	bool join_finished;
 	struct sd_node this_node;
 
 	struct cluster_info cinfo;
-- 
1.7.9.5




More information about the sheepdog mailing list