From c7bd6f02c74513f29be12ae47808ca1a1ddaec9f Mon Sep 17 00:00:00 2001 From: Douglas Fuller Date: Tue, 10 Apr 2018 15:53:11 -0400 Subject: [PATCH] cephfs: deprecate ceph mds deactivate MDS deactivation is now handled by the max_mds parameter. Deprecate ceph mds deactivate and note it to be removed in a future release. Signed-off-by: Douglas Fuller --- PendingReleaseNotes | 4 ++++ src/mon/MDSMonitor.cc | 33 +-------------------------------- src/mon/MonCommands.h | 4 ++-- 3 files changed, 7 insertions(+), 34 deletions(-) diff --git a/PendingReleaseNotes b/PendingReleaseNotes index 8330904b6b8..562c5494846 100644 --- a/PendingReleaseNotes +++ b/PendingReleaseNotes @@ -41,6 +41,10 @@ enabled by default. ceph fs set allow_dirfrags is now deprecated and will be removed in a future release. + * MDS daemons now activate and deactivate based on the value of + max_mds. Accordingly, ceph mds deactivate has been deprecated as it + is now redundant. + * New CephFS file system attributes session_timeout and session_autoclose are configurable via `ceph fs set`. The MDS config options mds_session_timeout, mds_session_autoclose, and mds_max_file_size are now diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index bb15aab4bcd..71da3575d59 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -1295,38 +1295,7 @@ int MDSMonitor::filesystem_command( auto &pending = get_pending_fsmap_writeable(); if (prefix == "mds deactivate") { - mds_role_t role; - r = parse_role(whostr, &role, ss); - if (r < 0 ) { - return r; - } - const auto &fs = pending.get_filesystem(role.fscid); - - if (!fs->mds_map.is_active(role.rank)) { - r = -EEXIST; - ss << "mds." << role << " not active (" - << ceph_mds_state_name(fs->mds_map.get_state(role.rank)) << ")"; - } else if (fs->mds_map.get_root() == role.rank || - fs->mds_map.get_tableserver() == role.rank) { - r = -EINVAL; - ss << "can't tell the root (" << fs->mds_map.get_root() - << ") or tableserver (" << fs->mds_map.get_tableserver() - << ") to deactivate"; - } else if (role.rank != fs->mds_map.get_last_in_mds()) { - r = -EINVAL; - ss << "mds." << role << " doesn't have the max rank (" - << fs->mds_map.get_last_in_mds() << ")"; - } else if (fs->mds_map.get_num_in_mds() <= size_t(fs->mds_map.get_max_mds())) { - r = -EBUSY; - ss << "must decrease max_mds or else MDS will immediately reactivate"; - } else { - r = 0; - mds_gid_t gid = fs->mds_map.up.at(role.rank); - ss << "telling mds." << role << " " - pending.modify_daemon(gid, [](MDSMap::mds_info_t *info) { - info->state = MDSMap::STATE_STOPPING; - }); - } + ss << "This command is deprecated because it is obsolete; to deactivate one or more MDS, decrease max_mds appropriately (ceph fs set max_mds)"; } else if (prefix == "mds set_state") { mds_gid_t gid; if (!cmd_getval(g_ceph_context, cmdmap, "gid", gid)) { diff --git a/src/mon/MonCommands.h b/src/mon/MonCommands.h index 9daefb0671d..01983d6d391 100644 --- a/src/mon/MonCommands.h +++ b/src/mon/MonCommands.h @@ -306,9 +306,9 @@ COMMAND("mds compat show", "show mds compatibility settings", \ "mds", "r", "cli,rest") COMMAND_WITH_FLAG("mds stop name=role,type=CephString", "stop mds", \ "mds", "rw", "cli,rest", FLAG(OBSOLETE)) -COMMAND("mds deactivate name=role,type=CephString", +COMMAND_WITH_FLAG("mds deactivate name=role,type=CephString", "clean up specified MDS rank (use with `set max_mds` to shrink cluster)", \ - "mds", "rw", "cli,rest") + "mds", "rw", "cli,rest", FLAG(OBSOLETE)) COMMAND_WITH_FLAG("mds set_max_mds " \ "name=maxmds,type=CephInt,range=0", \ "set max MDS index", "mds", "rw", "cli,rest", FLAG(OBSOLETE)) -- 2.39.5