]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: add lockup debugging command
authorPatrick Donnelly <pdonnell@redhat.com>
Wed, 27 Mar 2024 16:24:28 +0000 (12:24 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Thu, 28 Mar 2024 18:46:27 +0000 (14:46 -0400)
To artificially make the rank unresponsive for a time.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit d05b116239105980107a4bed9f47f65e1628997e)

src/mds/MDSDaemon.cc

index fa430a30bc475894260ea020d097e0f674043718..699da57e26550d805c0c9d06b3ede2bc8b6409fe 100644 (file)
@@ -149,6 +149,13 @@ void MDSDaemon::asok_command(
   if (command == "status") {
     dump_status(f);
     r = 0;
+  } else if (command == "lockup") {
+    int64_t millisecs;
+    cmd_getval(cmdmap, "millisecs", millisecs);
+    derr << "(lockup) sleeping with mds_lock for " << millisecs << dendl;
+    std::lock_guard l(mds_lock);
+    std::this_thread::sleep_for(std::chrono::milliseconds(millisecs));
+    r = 0;
   } else if (command == "exit") {
     outbl.append("Exiting...\n");
     r = 0;
@@ -256,6 +263,11 @@ void MDSDaemon::set_up_admin_socket()
   r = admin_socket->register_command("status", asok_hook,
                                     "high-level status of MDS");
   ceph_assert(r == 0);
+  r = admin_socket->register_command("lockup "
+                                    "name=millisecs,type=CephInt,req=true,range=0"
+                                     , asok_hook
+                                    , "sleep with mds_lock held (dev)");
+  ceph_assert(r == 0);
   r = admin_socket->register_command("dump_ops_in_flight", asok_hook,
                                     "show the ops currently in flight");
   ceph_assert(r == 0);