]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: kill session when mds do ms_handle_remote_reset 45098/head
authorIvanGuan <yunfei.guan@xtaotech.com>
Tue, 18 Jan 2022 13:01:59 +0000 (21:01 +0800)
committerVenky Shankar <vshankar@redhat.com>
Mon, 21 Feb 2022 09:56:56 +0000 (15:26 +0530)
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 <yunfeiguan@xtaotech.com>
(cherry picked from commit 3651deb4e0b0c102adcaddce79ee4e053f033418)

src/mds/MDSDaemon.cc

index f1c2f66941b62879e7629d73a0e24b8afaa296f6..f08bea6c87513bc3834959135dab8f3ddbee0d1e 100644 (file)
@@ -1037,6 +1037,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);
     }
   }
 }