]> 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>
Mon, 21 Oct 2019 02:57:06 +0000 (10:57 +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 4a038067e8290730d052c222a1309c383c584b52..6032aca67cfb6e97bd9b49e01ad86e8fe7fa28ef 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 e0cd4c9265e21378ac140c1b2c9a8242bc6ed2e0..35bc42739087359ff28c7fbe20b777052f9f1dc7 100644 (file)
@@ -850,11 +850,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()) {