[sheepdog] [PATCH] shepherd: show warning at startup

MORITA Kazutaka morita.kazutaka at gmail.com
Fri May 31 12:04:18 CEST 2013


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

The current shepherd driver doesn't handle node change events as sheep
expects.  This patch prints a warning message to notice the user that
shepherd is not suitable for production, and adds some FIXME comments
that must be done before we remove the warning message.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 sheep/cluster/shepherd.c |    9 +++++++++
 shepherd/shepherd.c      |    3 +++
 2 files changed, 12 insertions(+)

diff --git a/sheep/cluster/shepherd.c b/sheep/cluster/shepherd.c
index ac57503..2bc93d2 100644
--- a/sheep/cluster/shepherd.c
+++ b/sheep/cluster/shepherd.c
@@ -111,6 +111,10 @@ retry:
 			exit(1);
 		}
 
+		/*
+		 * FIXME: member change events must be ordered with nonblocked
+		 *        events
+		 */
 		res = sd_check_join_cb(&join->node, join->opaque);
 		if (res == CJ_RES_FAIL) {
 			sd_eprintf("sd_check_join_cb() failed");
@@ -171,6 +175,7 @@ retry:
 		nr_nodes = join_reply->nr_nodes;
 	}
 
+	/* FIXME: member change events must be ordered with nonblocked events */
 	sd_join_handler(&this_node, nodes, nr_nodes,
 			join_reply->res, join_reply->opaque);
 
@@ -337,6 +342,7 @@ static void msg_new_node(struct sph_msg *rcv)
 		exit(1);
 	}
 
+	/* FIXME: member change events must be ordered with nonblocked events */
 	res = sd_check_join_cb(&join->node, join->opaque);
 
 	join->res = res;
@@ -379,6 +385,8 @@ static void msg_new_node_finish(struct sph_msg *rcv)
 
 	sd_iprintf("new node: %s",
 		node_to_str(&join_node_finish->new_node));
+
+	/* FIXME: member change events must be ordered with nonblocked events */
 	sd_join_handler(&join_node_finish->new_node, nodes, nr_nodes,
 			join_node_finish->res, jm);
 
@@ -452,6 +460,7 @@ static void do_leave_sheep(void)
 removed:
 	sd_dprintf("calling sd_leave_handler(), sender: %s",
 		node_to_str(&sender));
+	/* FIXME: member change events must be ordered with nonblocked events */
 	sd_leave_handler(&sender, nodes, nr_nodes);
 }
 
diff --git a/shepherd/shepherd.c b/shepherd/shepherd.c
index 6eef5a3..418d3ad 100644
--- a/shepherd/shepherd.c
+++ b/shepherd/shepherd.c
@@ -790,6 +790,9 @@ int main(int argc, char **argv)
 	struct option *long_options;
 	const char *short_options;
 
+	printf(TEXT_BOLD_RED "** WARNING: shepherd is still only suitable for "
+	       "testing and review **" TEXT_NORMAL "\n");
+
 	progname = argv[0];
 
 	install_crash_handler(crash_handler);
-- 
1.7.9.5




More information about the sheepdog mailing list