[Sheepdog] [PATCH] sheep: get vdi bitmap correctly in join phase

Liu Yuan namei.unix at gmail.com
Sat Sep 10 18:49:20 CEST 2011


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

After the new node joins, command *collie-vdi-list*
cannot list any vdi information, that are created
before this node is joined. This is because in the
join phase, get_vdi_bitmap_from_all() cannot get corret
vdi bitmap *if* there is no node in sd_node_list.
This patch moves this function after the function
which updates the sd_node_list.

With this patch, collie-vdi-list works as expected in
newly added nodes.

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 sheep/group.c |   13 ++-----------
 1 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/sheep/group.c b/sheep/group.c
index eb0c4e2..22c4f66 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -863,17 +863,6 @@ static void __sd_deliver(struct cpg_event *cevent)
 			break;
 		}
 	}
-
-	if (m->state == DM_FIN) {
-		switch (m->op) {
-		case SD_MSG_JOIN:
-			if (((struct join_message *)m)->cluster_status == SD_STATUS_OK)
-				if (sys->status != SD_STATUS_OK)
-					get_vdi_bitmap_from_all();
-			break;
-		}
-	}
-
 }
 
 static void send_join_response(struct work_deliver *w)
@@ -902,6 +891,8 @@ static void __sd_deliver_done(struct cpg_event *cevent)
 		switch (m->op) {
 		case SD_MSG_JOIN:
 			update_cluster_info((struct join_message *)m);
+			if (((struct join_message *)m)->cluster_status == SD_STATUS_OK)
+					get_vdi_bitmap_from_all();
 			break;
 		case SD_MSG_LEAVE:
 			node = find_node(&sys->sd_node_list, m->nodeid, m->pid);
-- 
1.7.5.1




More information about the sheepdog mailing list