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 | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/sheep/sdnet.c b/sheep/sdnet.c index da946af..230cc5e 100644 --- a/sheep/sdnet.c +++ b/sheep/sdnet.c @@ -225,20 +225,17 @@ static int check_request(struct request *req) return 0; 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 |