From cd29206974427a4f6ab410b1482bbd8ebfb55fbd Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Wed, 19 Jun 2019 11:42:05 +0800 Subject: [PATCH] mds: remove the code that skip evicting the only client There is already logic that defer marking unresponsive client stale. No reason to defer evicting the only stale client. Signed-off-by: "Yan, Zheng" --- qa/tasks/cephfs/test_misc.py | 37 ------------------------------------ src/mds/Server.cc | 5 ----- 2 files changed, 42 deletions(-) diff --git a/qa/tasks/cephfs/test_misc.py b/qa/tasks/cephfs/test_misc.py index 26a551e2d6c..ce6dab253fa 100644 --- a/qa/tasks/cephfs/test_misc.py +++ b/qa/tasks/cephfs/test_misc.py @@ -110,43 +110,6 @@ class TestMisc(CephFSTestCase): self.fs.metadata_pool_name, data_pool_name) - def test_evict_client(self): - """ - Check that a slow client session won't get evicted if it's the - only session - """ - - session_autoclose = self.fs.get_var("session_autoclose") - - self.mount_b.umount_wait() - ls_data = self.fs.mds_asok(['session', 'ls']) - self.assert_session_count(1, ls_data) - - mount_a_client_id = self.mount_a.get_global_id() - self.mount_a.kill() - self.mount_a.kill_cleanup() - - time.sleep(session_autoclose * 1.5) - ls_data = self.fs.mds_asok(['session', 'ls']) - self.assert_session_count(1, ls_data) - - self.fs.mds_asok(['session', 'evict', "%s" % mount_a_client_id]) - - self.mount_a.mount() - self.mount_a.wait_until_mounted() - self.mount_b.mount() - self.mount_b.wait_until_mounted() - - ls_data = self._session_list() - self.assert_session_count(2, ls_data) - - self.mount_a.kill() - self.mount_a.kill_cleanup() - - time.sleep(session_autoclose * 1.5) - ls_data = self.fs.mds_asok(['session', 'ls']) - self.assert_session_count(1, ls_data) - def test_cap_revoke_nonresponder(self): """ Check that a client is evicted if it has not responded to cap revoke diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 6230e76187c..54c9c7d15df 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -1021,11 +1021,6 @@ void Server::find_idle_sessions() return; } - if (mds->sessionmap.get_sessions().size() == 1 && mds->mdsmap->get_num_in_mds() == 1) { - dout(20) << "skipping client eviction because there is only one" << dendl; - return; - } - // Collect a list of sessions exceeding the autoclose threshold const auto sessions_p2 = mds->sessionmap.by_state.find(Session::STATE_STALE); if (sessions_p2 != mds->sessionmap.by_state.end() && !sessions_p2->second->empty()) { -- 2.47.3