From e0d1127205bb45bb623a50b4b68ae85f7b083e04 Mon Sep 17 00:00:00 2001 From: John Spray Date: Thu, 16 Mar 2017 18:05:15 +0000 Subject: [PATCH] mon: remove `mds tell` command Fixes: http://tracker.ceph.com/issues/19288 Signed-off-by: John Spray --- src/mon/MDSMonitor.cc | 42 ------------------------------------------ src/mon/MonCommands.h | 4 ++-- 2 files changed, 2 insertions(+), 44 deletions(-) diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 0758eca19d3..3b752e39cf9 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -952,48 +952,6 @@ bool MDSMonitor::preprocess_command(MonOpRequestRef op) ss << "got fsmap epoch " << fsmap.get_epoch(); r = 0; } - } else if (prefix == "mds tell") { - string whostr; - cmd_getval(g_ceph_context, cmdmap, "who", whostr); - vectorargs_vec; - cmd_getval(g_ceph_context, cmdmap, "args", args_vec); - - if (whostr == "*") { - r = -ENOENT; - const auto info_map = fsmap.get_mds_info(); - for (const auto &i : info_map) { - m->cmd = args_vec; - mon->send_command(i.second.get_inst(), m->cmd); - r = 0; - } - if (r == -ENOENT) { - ss << "no mds active"; - } else { - ss << "ok"; - } - } else { - if (fsmap.legacy_client_fscid) { - auto fs = fsmap.filesystems.at(fsmap.legacy_client_fscid); - errno = 0; - long who_l = strtol(whostr.c_str(), 0, 10); - if (!errno && who_l >= 0) { - mds_rank_t who = mds_rank_t(who_l); - if (fs->mds_map.is_up(who)) { - m->cmd = args_vec; - mon->send_command(fs->mds_map.get_inst(who), m->cmd); - r = 0; - ss << "ok"; - } else { - ss << "mds." << who << " not up"; - r = -ENOENT; - } - } else { - ss << "specify mds number or *"; - } - } else { - ss << "no legacy filesystem set"; - } - } } else if (prefix == "mds compat show") { if (f) { f->open_object_section("mds_compat"); diff --git a/src/mon/MonCommands.h b/src/mon/MonCommands.h index cefb2102cfe..5a5dcb61d29 100644 --- a/src/mon/MonCommands.h +++ b/src/mon/MonCommands.h @@ -313,10 +313,10 @@ COMMAND_WITH_FLAG("mds getmap " \ COMMAND("mds metadata name=who,type=CephString,req=false", "fetch metadata for mds ", "mds", "r", "cli,rest") -COMMAND("mds tell " \ +COMMAND_WITH_FLAG("mds tell " \ "name=who,type=CephString " \ "name=args,type=CephString,n=N", \ - "send command to particular mds", "mds", "rw", "cli,rest") + "send command to particular mds", "mds", "rw", "cli,rest", FLAG(OBSOLETE)) COMMAND("mds compat show", "show mds compatibility settings", \ "mds", "r", "cli,rest") COMMAND_WITH_FLAG("mds stop name=who,type=CephString", "stop mds", \ -- 2.47.3