[sheepdog] [PATCH update] sheep: don't exit at EIO
Liu Yuan
namei.unix at gmail.com
Mon Sep 17 12:38:55 CEST 2012
From: Liu Yuan <tailai.ly at taobao.com>
We don't work with local driver yet because it doesn't handle LEAVE correctly,
but I have tested with corosync, it works:
the failed node can act as a gateway node seamlessly.
Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
sheep/request.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/sheep/request.c b/sheep/request.c
index 91a84b5..0923b8c 100644
--- a/sheep/request.c
+++ b/sheep/request.c
@@ -46,13 +46,19 @@ static void io_op_done(struct work *work)
{
struct request *req = container_of(work, struct request, work);
- if (req->rp.result == SD_RES_EIO) {
+ switch (req->rp.result) {
+ case SD_RES_EIO:
req->rp.result = SD_RES_NETWORK_ERROR;
eprintf("leaving sheepdog cluster\n");
leave_cluster();
- /* TODO: make this node work as a gateway */
- exit(1);
+ break;
+ case SD_RES_SUCCESS:
+ break;
+ default:
+ dprintf("unhandled error %d\n", req->rp.result);
+ break;
+
}
put_request(req);
@@ -92,13 +98,14 @@ static void gateway_op_done(struct work *work)
if (is_access_local(req, hdr->obj.oid)) {
eprintf("leaving sheepdog cluster\n");
leave_cluster();
- /* TODO: make this node work as a gateway */
- exit(1);
goto retry;
}
break;
case SD_RES_SUCCESS:
break;
+ default:
+ dprintf("unhandled error %d\n", req->rp.result);
+ break;
}
put_request(req);
--
1.7.10.2
More information about the sheepdog
mailing list