[sheepdog] [PATCH v5 8/8] sheep: make gateway requests only retry when requested object is local
levin li
levin108 at gmail.com
Mon May 28 07:21:51 CEST 2012
From: levin li <xingke.lwp at taobao.com>
Sorry, I misunderstand the req->local_id, if it's set, the request
would definitely request a local object.
----------------------------------------------------------------- >8
We should not make gateway retry in check_request when the
requested object in recovery is not local, in the case of requesting a
non-local object we should make it retry in io_op_done(), if the
requesting object is local, then we should make the gateway request
to retry.
Signed-off-by: levin li <xingke.lwp at taobao.com>
---
sheep/sdnet.c | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)
diff --git a/sheep/sdnet.c b/sheep/sdnet.c
index 7cbaff8..4224220 100644
--- a/sheep/sdnet.c
+++ b/sheep/sdnet.c
@@ -215,19 +215,14 @@ static int check_request(struct request *req)
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);
- }
+ /* Peer requests and gateway requests all need to retry */
+ 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