From 749ee198ecfffac67a896448229edce2e19ba633 Mon Sep 17 00:00:00 2001 From: IvanGuan Date: Tue, 18 Jan 2022 21:01:59 +0800 Subject: [PATCH] mds: kill session when mds do ms_handle_remote_reset if the mds decide to reuse the old connection it will do reset_session and should also kill the session which are open state in MDSDaemon::ms_handle_remote_reset to prevent the situation client session is stuck in opening state and never has chance to becaome open. the root cause is client missed the request_open reply but the mds session has become open already. so we should kill the session in mds side and let mds recreate the session when received the connect request from client. Fixes: http://tracker.ceph.com/issues/53911 Signed-off-by: YunfeiGuan (cherry picked from commit 3651deb4e0b0c102adcaddce79ee4e053f033418) --- src/mds/MDSDaemon.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mds/MDSDaemon.cc b/src/mds/MDSDaemon.cc index 8b653c063f5da..1dbb81d6d063a 100644 --- a/src/mds/MDSDaemon.cc +++ b/src/mds/MDSDaemon.cc @@ -1030,6 +1030,9 @@ void MDSDaemon::ms_handle_remote_reset(Connection *con) dout(3) << "ms_handle_remote_reset closing connection for session " << session->info.inst << dendl; con->mark_down(); con->set_priv(nullptr); + } else if (session->is_open()) { + dout(3) << "ms_handle_remote_reset kill session " << session->info.inst << dendl; + mds_rank->server->kill_session(session, nullptr); } } } -- 2.39.5