From: Patrick Donnelly Date: Wed, 27 Mar 2024 16:24:28 +0000 (-0400) Subject: mds: add lockup debugging command X-Git-Tag: testing/wip-batrick-testing-20240411.154038~98^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=d05b116239105980107a4bed9f47f65e1628997e;p=ceph-ci.git mds: add lockup debugging command To artificially make the rank unresponsive for a time. Signed-off-by: Patrick Donnelly --- diff --git a/src/mds/MDSDaemon.cc b/src/mds/MDSDaemon.cc index fa430a30bc4..699da57e265 100644 --- a/src/mds/MDSDaemon.cc +++ b/src/mds/MDSDaemon.cc @@ -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);