[sheepdog] [PATCH v2] zookeeper: add error message when found ZNOCHILDRENFOREPHEMERALS

Kai Zhang kyle at zelin.io
Sat Jun 29 07:14:16 CEST 2013


Signed-off-by: Kai Zhang <kyle at zelin.io>
---

v2: add comments to explain why the error is caused by incompatible
    version

 sheep/cluster/zookeeper.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/sheep/cluster/zookeeper.c b/sheep/cluster/zookeeper.c
index daafc4d..5e2018e 100644
--- a/sheep/cluster/zookeeper.c
+++ b/sheep/cluster/zookeeper.c
@@ -19,6 +19,7 @@
 #include <pthread.h>
 
 #include "cluster.h"
+#include "config.h"
 #include "event.h"
 #include "work.h"
 #include "util.h"
@@ -152,6 +153,14 @@ static struct zk_node this_node;
 		sd_eprintf("failed, path:%s, %s", path, zerror(rc));	\
 	case ZOK:							\
 		break;							\
+	case ZNOCHILDRENFOREPHEMERALS:					\
+		/*							\
+		 * Because code has guaranteed that parent nodes are	\
+		 * always non-ephemeral, this could happen only when	\
+		 * sheep joins a cluster in an incompatible version.	\
+		 */							\
+		sd_eprintf("incompatible version of sheep %s",		\
+			   PACKAGE_VERSION);				\
 	default:							\
 		panic("failed, path:%s, %s", path, zerror(rc));		\
 	}
--
1.7.9.5




More information about the sheepdog mailing list