lustre_msg_set_transno(req->rq_reqmsg, req->rq_transno);
}
+ if (lustre_msg_get_transno(req->rq_repmsg) ||
+ lustre_msg_get_opc(req->rq_reqmsg) == LDLM_ENQUEUE)
+ imp->imp_no_cached_data = 0;
+
if (imp->imp_replayable) {
/* if other threads are waiting for ptlrpc_free_committed()
* they could continue the work of freeing RPCs. That reduces
return 1;
}
if (!list_empty(&imp->imp_replay_list)) {
- req = list_first_entry(&imp->imp_committed_list,
+ req = list_first_entry(&imp->imp_replay_list,
struct ptlrpc_request, rq_replay_list);
*transno = req->rq_transno;
if (req->rq_transno == 0) {
imp->imp_remote_handle =
*lustre_msg_get_handle(request->rq_repmsg);
+ imp->imp_no_cached_data = 1;
+
/* Initial connects are allowed for clients with non-random
* uuids when servers are in recovery. Simply signal the
* servers replay is complete and wait in REPLAY_WAIT.
*lustre_msg_get_handle(request->rq_repmsg);
import_set_state(imp, LUSTRE_IMP_RECOVER);
} else {
- DEBUG_REQ(D_HA, request,
- "%s: evicting (reconnect/recover flags not set: %x)",
- imp->imp_obd->obd_name, msg_flags);
imp->imp_remote_handle =
*lustre_msg_get_handle(request->rq_repmsg);
- import_set_state(imp, LUSTRE_IMP_EVICTED);
+ if (!imp->imp_no_cached_data) {
+ DEBUG_REQ(D_HA, request,
+ "%s: evicting (reconnect/recover flags not set: %x)",
+ imp->imp_obd->obd_name, msg_flags);
+ import_set_state(imp, LUSTRE_IMP_EVICTED);
+ } else {
+ ptlrpc_activate_import(imp, true);
+ }
}
/* Sanity checks for a reconnected import. */
}
run_test 154 "corruption update llog can be skipped"
+test_155() {
+ local lsoutput1
+ local lsoutput2
+
+ touch $DIR/$tfile
+ lsoutput1=$(ls -l $DIR)
+
+ zconf_umount $HOSTNAME $MOUNT || error "umount failed"
+ # make sure that last_rcvd update is committed
+ do_facet mds1 sync
+ zconf_mount $HOSTNAME $MOUNT || error "mount failed"
+
+ replay_barrier_nosync mds1
+
+ fail_nodf mds1
+
+ lsoutput2=$(ls -l $DIR) || error "ls failed"
+ [[ $lsoutput1 == $lsoutput2 ]] || error "$lsoutput1 != $lsoutput2"
+}
+run_test 155 "failover after client remount"
+
complete_test $SECONDS
check_and_cleanup_lustre
exit_status