Whamcloud - gitweb
LU-6802 recovery: don't skip open replay on reconnect 71/15871/2
authorNiu Yawei <yawei.niu@intel.com>
Thu, 6 Aug 2015 08:14:40 +0000 (04:14 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 18 Aug 2015 11:11:42 +0000 (11:11 +0000)
Once reconnect happened during replay, we'd continue the open
replay with the last failed replay, but not the next.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: I164c40db143ca860ab59f60582942614d5fb7925
Reviewed-on: http://review.whamcloud.com/15871
Tested-by: Jenkins
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Hongchao Zhang <hongchao.zhang@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/ptlrpc/import.c
lustre/ptlrpc/recover.c

index 709cbe9..e8f595b 100644 (file)
@@ -1211,12 +1211,6 @@ static int ptlrpc_connect_interpret(const struct lu_env *env,
                        lustre_msg_get_last_committed(request->rq_repmsg));
         }
 
-       /* LU-6802: Reset replay cursor on successful reconnect */
-       spin_lock(&imp->imp_lock);
-       imp->imp_replay_cursor = &imp->imp_committed_list;
-       imp->imp_last_replay_transno = 0;
-       spin_unlock(&imp->imp_lock);
-
 finish:
        rc = ptlrpc_import_recovery_state_machine(imp);
        if (rc == -ENOTCONN) {
index cbb435e..4a3ba0c 100644 (file)
@@ -119,7 +119,10 @@ int ptlrpc_replay_next(struct obd_import *imp, int *inflight)
                        /* Since the imp_committed_list is immutable before
                         * all of it's requests being replayed, it's safe to
                         * use a cursor to accelerate the search */
-                       imp->imp_replay_cursor = imp->imp_replay_cursor->next;
+                       if (!imp->imp_resend_replay ||
+                           imp->imp_replay_cursor == &imp->imp_committed_list)
+                               imp->imp_replay_cursor =
+                                       imp->imp_replay_cursor->next;
 
                        while (imp->imp_replay_cursor !=
                               &imp->imp_committed_list) {