[sheepdog] [PATCH 8/8] make gateway requests only retry in io_op_done()

levin li levin108 at gmail.com
Tue May 22 04:51:08 CEST 2012


From: levin li <xingke.lwp at taobao.com>

We should not make gateway retry in check_request when the
requested object is in recovery, we should make it retry in
io_op_done(), gateway request does not access local objects,
so we should not make it retry when the local objects are in
recovery.

Signed-off-by: levin li <xingke.lwp at taobao.com>
---
 sheep/sdnet.c |   23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)

diff --git a/sheep/sdnet.c b/sheep/sdnet.c
index 99d5abd..5bfff1b 100644
--- a/sheep/sdnet.c
+++ b/sheep/sdnet.c
@@ -225,19 +225,16 @@ static int check_request(struct request *req)
 		return 0;
 
 	if (is_recovering_oid(req->local_oid) &&
-		!(req->rq.flags & SD_FLAG_CMD_RECOVERY)) {
-		if (req->rq.flags & SD_FLAG_CMD_IO_LOCAL) {
-			/* Sheep peer request */
-			if (is_recovery_init())
-				list_add_tail(&req->request_list,
-						&sys->wait_rw_queue);
-			else
-				list_add_tail(&req->request_list,
-						&sys->wait_obj_queue);
-		} else {
-			/* Gateway request */
-			list_add_tail(&req->request_list, &sys->req_wait_for_obj_list);
-		}
+		!(req->rq.flags & SD_FLAG_CMD_RECOVERY) &&
+		req->rq.flags & SD_FLAG_CMD_IO_LOCAL) {
+		/* Sheep peer request */
+		if (is_recovery_init())
+			list_add_tail(&req->request_list,
+					&sys->wait_rw_queue);
+		else
+			list_add_tail(&req->request_list,
+					&sys->wait_obj_queue);
+
 		return -1;
 	}
 
-- 
1.7.10




More information about the sheepdog mailing list