From d05b116239105980107a4bed9f47f65e1628997e Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Wed, 27 Mar 2024 12:24:28 -0400 Subject: [PATCH] mds: add lockup debugging command To artificially make the rank unresponsive for a time. Signed-off-by: Patrick Donnelly --- src/mds/MDSDaemon.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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); -- 2.39.5