[Sheepdog] [PATCH 9/9] sheep: handle SD_OP_STAT_CLUSTER even when the node failed to join

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Sat Jan 1 20:53:20 CET 2011


The results of SD_OP_STAT_CLUSTER can tell us good information about
why this node failed to join the sheepdog cluster, so the request
should be handled even when the cluster status is
SD_STATUS_JOIN_FAILED.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 sheep/sdnet.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/sheep/sdnet.c b/sheep/sdnet.c
index 923121c..110ddff 100644
--- a/sheep/sdnet.c
+++ b/sheep/sdnet.c
@@ -183,7 +183,13 @@ static void queue_request(struct request *req)
 		return;
 	}
 
-	if (sys->status == SD_STATUS_JOIN_FAILED) {
+	/*
+	 * we can know why this node failed to join with
+	 * SD_OP_STAT_CLUSTER, so the request should be handled even
+	 * when the cluster status is SD_STATUS_JOIN_FAILED
+	 */
+	if (sys->status == SD_STATUS_JOIN_FAILED &&
+	    hdr->opcode != SD_OP_STAT_CLUSTER) {
 		rsp->result = SD_RES_JOIN_FAILED;
 		req->done(req);
 		return;
-- 
1.5.6.5




More information about the sheepdog mailing list