]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs: deprecate ceph mds deactivate
authorDouglas Fuller <dfuller@redhat.com>
Tue, 10 Apr 2018 19:53:11 +0000 (15:53 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Tue, 17 Apr 2018 18:01:23 +0000 (11:01 -0700)
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 <dfuller@redhat.com>
PendingReleaseNotes
src/mon/MDSMonitor.cc
src/mon/MonCommands.h

index 8330904b6b8758c06be2bf7db617ff317e72171a..562c54948460c843c35e00429d76746148d4fc3c 100644 (file)
     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
index bb15aab4bcdac567577a8e4bc036a15d63ef8862..71da3575d5975a9859d43d2754b22ac220157bb7 100644 (file)
@@ -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 <fsname> max_mds)";
   } else if (prefix == "mds set_state") {
     mds_gid_t gid;
     if (!cmd_getval(g_ceph_context, cmdmap, "gid", gid)) {
index 9daefb0671d710c36dedec72f38e08c3fe1f9063..01983d6d391673e504f4ff12e2c669cb9dac5a46 100644 (file)
@@ -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))