From f3ce48ce543791d60326777d95ab2c9c03826965 Mon Sep 17 00:00:00 2001 From: Vladimir Saveliev Date: Sat, 21 May 2016 06:10:43 +0300 Subject: [PATCH] LU-8197 ptlrpc: do not reduce replay request deadline New timeout for a replay request sent to a client with early reply is calculated without taking into account that new deadline for the replay request on server side is calculated based upon obd_recovery_timeout. That results in reducing replay deadline which forces to early disconnect of the client. Calculate the timeout sent in early reply to a replay request in according to new deadline of the replay request on server side. Seagate-bug-id: MRP-3249 Signed-off-by: Vladimir Saveliev Change-Id: I478ca84a9627816be886a077170285f8af4bfc29 Reviewed-on: http://review.whamcloud.com/20399 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Mike Pershin Reviewed-by: Hongchao Zhang Reviewed-by: Oleg Drokin --- lustre/ptlrpc/niobuf.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/lustre/ptlrpc/niobuf.c b/lustre/ptlrpc/niobuf.c index 349638b..3da77ec 100644 --- a/lustre/ptlrpc/niobuf.c +++ b/lustre/ptlrpc/niobuf.c @@ -504,11 +504,24 @@ static void ptlrpc_at_set_reply(struct ptlrpc_request *req, int flags) * (to be ignored by client) if it's an error reply during recovery. * (bz15815) */ if (req->rq_type == PTL_RPC_MSG_ERR && - (req->rq_export == NULL || req->rq_export->exp_obd->obd_recovering)) + (req->rq_export == NULL || + req->rq_export->exp_obd->obd_recovering)) { lustre_msg_set_timeout(req->rq_repmsg, 0); - else - lustre_msg_set_timeout(req->rq_repmsg, - at_get(&svcpt->scp_at_estimate)); + } else { + __u32 timeout; + + if (req->rq_export && req->rq_reqmsg != NULL && + lustre_msg_get_flags(req->rq_reqmsg) & + (MSG_REPLAY | MSG_REQ_REPLAY_DONE | MSG_LOCK_REPLAY_DONE)) + timeout = cfs_time_current_sec() - + req->rq_arrival_time.tv_sec + + min(at_extra, + req->rq_export->exp_obd-> + obd_recovery_timeout / 4); + else + timeout = at_get(&svcpt->scp_at_estimate); + lustre_msg_set_timeout(req->rq_repmsg, timeout); + } if (req->rq_reqmsg && !(lustre_msghdr_get_flags(req->rq_reqmsg) & MSGHDR_AT_SUPPORT)) { -- 1.8.3.1