]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mds: remove cache drop asok command
authorPatrick Donnelly <pdonnell@redhat.com>
Wed, 23 Jan 2019 02:26:38 +0000 (18:26 -0800)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 23 Jan 2019 14:48:58 +0000 (06:48 -0800)
`cache drop` is a long running command that will block the asok interface
(while the tell version does not). Attempting to abort the command with ^C or
equivalents will simply cause the `ceph` command to exit but won't stop the
asok command handler from waiting for the cache drop operation to complete.

Instead, just allow the tell version.

Fixes: http://tracker.ceph.com/issues/38020
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
PendingReleaseNotes
qa/tasks/cephfs/test_misc.py
src/mds/MDSDaemon.cc
src/mds/MDSRank.cc

index 39f273544411f6c22916120a3909d1e8c26a40cd..e3a094a118117c398e4b14fcbe6f94e2bfd2994f 100644 (file)
   system. This is a single command that unsets the joinable flag on the file
   system and brings down all of its ranks.
 
+* The `cache drop` admin socket command has been removed. The `ceph tell mds.X
+  cache drop` remains.
 
 Upgrading from Luminous
 -----------------------
index 36b4e41002ca791a46a67c3b73153723ac3c7987..15bfcdabacfbe20a8797991913c8f6426fe647c6 100644 (file)
@@ -225,18 +225,15 @@ class TestMisc(CephFSTestCase):
         info = self.fs.mds_asok(['dump', 'inode', hex(ino)])
         assert info['path'] == "/foo"
 
-    def _run_drop_cache_cmd(self, timeout, use_tell):
+    def _run_drop_cache_cmd(self, timeout):
         drop_res = None
-        if use_tell:
-            mds_id = self.fs.get_lone_mds_id()
-            drop_res = json.loads(
-                self.fs.mon_manager.raw_cluster_cmd("tell", "mds.{0}".format(mds_id),
-                                                    "cache", "drop", str(timeout)))
-        else:
-            drop_res = self.fs.mds_asok(["cache", "drop", str(timeout)])
+        mds_id = self.fs.get_lone_mds_id()
+        drop_res = json.loads(
+            self.fs.mon_manager.raw_cluster_cmd("tell", "mds.{0}".format(mds_id),
+                                                "cache", "drop", str(timeout)))
         return drop_res
 
-    def _drop_cache_command(self, timeout, use_tell=True):
+    def _drop_cache_command(self, timeout):
         self.mount_b.umount_wait()
         ls_data = self.fs.mds_asok(['session', 'ls'])
         self.assert_session_count(1, ls_data)
@@ -244,12 +241,12 @@ class TestMisc(CephFSTestCase):
         # create some files
         self.mount_a.create_n_files("dc-dir/dc-file", 1000)
         # drop cache
-        drop_res = self._run_drop_cache_cmd(timeout, use_tell)
+        drop_res = self._run_drop_cache_cmd(timeout)
 
         self.assertTrue(drop_res['client_recall']['return_code'] == 0)
         self.assertTrue(drop_res['flush_journal']['return_code'] == 0)
 
-    def _drop_cache_command_timeout(self, timeout, use_tell=True):
+    def _drop_cache_command_timeout(self, timeout):
         self.mount_b.umount_wait()
         ls_data = self.fs.mds_asok(['session', 'ls'])
         self.assert_session_count(1, ls_data)
@@ -259,7 +256,7 @@ class TestMisc(CephFSTestCase):
 
         # simulate client death and try drop cache
         self.mount_a.kill()
-        drop_res = self._run_drop_cache_cmd(timeout, use_tell)
+        drop_res = self._run_drop_cache_cmd(timeout)
 
         self.assertTrue(drop_res['client_recall']['return_code'] == -errno.ETIMEDOUT)
         self.assertTrue(drop_res['flush_journal']['return_code'] == 0)
@@ -268,28 +265,14 @@ class TestMisc(CephFSTestCase):
         self.mount_a.mount()
         self.mount_a.wait_until_mounted()
 
-    def test_drop_cache_command_asok(self):
-        """
-        Basic test for checking drop cache command using admin socket.
-        Note that the cache size post trimming is not checked here.
-        """
-        self._drop_cache_command(10, use_tell=False)
-
-    def test_drop_cache_command_tell(self):
+    def test_drop_cache_command(self):
         """
         Basic test for checking drop cache command using tell interface.
         Note that the cache size post trimming is not checked here.
         """
         self._drop_cache_command(10)
 
-    def test_drop_cache_command_timeout_asok(self):
-        """
-        Check drop cache command with non-responding client using admin
-        socket. Note that the cache size post trimming is not checked here.
-        """
-        self._drop_cache_command_timeout(5, use_tell=False)
-
-    def test_drop_cache_command_timeout_tell(self):
+    def test_drop_cache_command_timeout(self):
         """
         Check drop cache command with non-responding client using tell
         interface. Note that the cache size post trimming is not checked
index 7aadfd43aff2d6e3e44f1bc53e7714ea2e7f8ff4..0c77f0d70bcb73ed003118639d30d4cdf76dc61b 100644 (file)
@@ -260,11 +260,6 @@ void MDSDaemon::set_up_admin_socket()
                                      asok_hook,
                                      "show cache status");
   ceph_assert(r == 0);
-  r = admin_socket->register_command("cache drop",
-                                     "cache drop name=timeout,type=CephInt,range=0,req=false",
-                                     asok_hook,
-                                     "drop cache");
-  ceph_assert(r == 0);
   r = admin_socket->register_command("dump tree",
                                     "dump tree "
                                     "name=root,type=CephString,req=true "
index 82eb2feafbb7bfcfb0b1325fb361f2d7a41ddf45..2ec4dfbfee5e53c6a5055da692b98ae62bc14723 100644 (file)
@@ -2517,18 +2517,6 @@ bool MDSRankDispatcher::handle_asok_command(std::string_view command,
   } else if (command == "cache status") {
     std::lock_guard l(mds_lock);
     mdcache->cache_status(f);
-  } else if (command == "cache drop") {
-    int64_t timeout;
-    if (!cmd_getval(g_ceph_context, cmdmap, "timeout", timeout)) {
-      timeout = 0;
-    }
-
-    C_SaferCond cond;
-    command_cache_drop((uint64_t)timeout, f, &cond);
-    int r = cond.wait();
-    if (r != 0) {
-      f->flush(ss);
-    }
   } else if (command == "dump tree") {
     command_dump_tree(cmdmap, ss, f);
   } else if (command == "dump loads") {