From 76040fdbbb739053695386e7ed6d0dcb1ea7539a Mon Sep 17 00:00:00 2001 From: Niu Yawei Date: Thu, 6 Aug 2015 04:14:40 -0400 Subject: [PATCH] LU-6802 recovery: don't skip open replay on reconnect 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 Change-Id: I164c40db143ca860ab59f60582942614d5fb7925 Reviewed-on: http://review.whamcloud.com/15871 Tested-by: Jenkins Reviewed-by: Jinshan Xiong Tested-by: Maloo Reviewed-by: Hongchao Zhang Reviewed-by: Oleg Drokin --- lustre/ptlrpc/import.c | 6 ------ lustre/ptlrpc/recover.c | 5 ++++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/lustre/ptlrpc/import.c b/lustre/ptlrpc/import.c index 709cbe9..e8f595b 100644 --- a/lustre/ptlrpc/import.c +++ b/lustre/ptlrpc/import.c @@ -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) { diff --git a/lustre/ptlrpc/recover.c b/lustre/ptlrpc/recover.c index cbb435e..4a3ba0c 100644 --- a/lustre/ptlrpc/recover.c +++ b/lustre/ptlrpc/recover.c @@ -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) { -- 1.8.3.1