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

levin li levin108 at gmail.com
Fri May 25 04:31:00 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 |   24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/sheep/sdnet.c b/sheep/sdnet.c
index a5b3e28..59f71ba 100644
--- a/sheep/sdnet.c
+++ b/sheep/sdnet.c
@@ -216,20 +216,16 @@ static int check_request(struct request *req)
 	   dead lock of recovery, if fails, recovery will take its own
 	   retrying mechanism. */
 	if (is_recoverying_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()) {
-				req->rp.result = SD_RES_OBJ_RECOVERING;
-				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()) {
+			req->rp.result = SD_RES_OBJ_RECOVERING;
+			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