Whamcloud - gitweb
LU-13899 tgt: drop old epoch request 12/39612/3
authorAlexander Zarochentsev <c17826@cray.com>
Fri, 31 Jul 2020 16:01:32 +0000 (19:01 +0300)
committerOleg Drokin <green@whamcloud.com>
Tue, 1 Sep 2020 03:42:47 +0000 (03:42 +0000)
Do not send -ESTALE back to the client
in case process_req_last_xid() detects
an old epoch request. Just drop reply
instead, otherwise -ESTALE may confuse
the client and have it accept an error
not attempting to resend the request.

Fixes: c1d465de13 ("LU-6655 ptlrpc: skip delayed replay requests")
HPE-bug-id: LUS-9097
Signed-off-by: Alexander Zarochentsev <alexander.zarochentsev@hpe.com>
Change-Id: I1a9ebc637f1357ca0027adbb6bb706287f4b5f4f
Reviewed-on: https://review.whamcloud.com/39612
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Alexey Lyashkov <alexey.lyashkov@hpe.com>
Reviewed-by: Andrew Perepechko <andrew.perepechko@hpe.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/target/tgt_handler.c

index 593fa72..83ecb5f 100644 (file)
@@ -684,8 +684,15 @@ static int process_req_last_xid(struct ptlrpc_request *req)
         * replay request will have the larger xid than "exp_last_xid"
         */
        if (req->rq_export->exp_conn_cnt >
-           lustre_msg_get_conn_cnt(req->rq_reqmsg))
+           lustre_msg_get_conn_cnt(req->rq_reqmsg)) {
+               CDEBUG(D_RPCTRACE,
+                      "Dropping request %llu from an old epoch %u/%u\n",
+                      req->rq_xid,
+                      lustre_msg_get_conn_cnt(req->rq_reqmsg),
+                      req->rq_export->exp_conn_cnt);
+               req->rq_no_reply = 1;
                GOTO(out, rc = -ESTALE);
+       }
 
        /* try to release in-memory reply data */
        if (tgt_is_multimodrpcs_client(exp)) {