]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: remove the code that skip evicting the only client
authorYan, Zheng <zyan@redhat.com>
Wed, 19 Jun 2019 03:42:05 +0000 (11:42 +0800)
committerYan, Zheng <zyan@redhat.com>
Thu, 11 Jul 2019 07:38:32 +0000 (15:38 +0800)
There is already logic that defer marking unresponsive client stale.
No reason to defer evicting the only stale client.

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
(cherry picked from commit cd29206974427a4f6ab410b1482bbd8ebfb55fbd)

 Conflicts:
qa/tasks/cephfs/test_misc.py

qa/tasks/cephfs/test_misc.py
src/mds/Server.cc

index dae8eb03b2ccefe77e7eed690738bf8cb6b1c9e5..fd243a043df1ba13e1ab62aeb6dba0113c910cd0 100644 (file)
@@ -111,43 +111,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
index a86446d82b47a93ca7b6d3a5fc618ff75770805a..9927f4e841463102645e19d5489c0c1993ed2e25 100644 (file)
@@ -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()) {