]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: remove 'mds setmap' command 8121/head
authorSage Weil <sage@redhat.com>
Tue, 15 Mar 2016 13:44:04 +0000 (09:44 -0400)
committerSage Weil <sage@redhat.com>
Thu, 17 Mar 2016 14:40:24 +0000 (10:40 -0400)
This command has no discernable purpose, and is difficult and
dangerous to support anyway.

Fixes: #15136
Signed-off-by: Sage Weil <sage@redhat.com>
doc/cephfs/administration.rst
doc/man/8/ceph.rst
src/mon/MDSMonitor.cc
src/mon/MonCommands.h
src/test/pybind/test_ceph_argparse.py

index 621a9cf57997dc8981d28b0046d2091eeb563665..2f6bb0b29eac8c41f8e87ba07697b26ca3114335 100644 (file)
@@ -103,10 +103,6 @@ filesystem.
 
     mds compat show
 
-::
-
-    mds setmap
-
 ::
 
     mds getmap
index 679963548b6ee5403ea857fcabaecd1e909e1307..a224d697fe23612b9793c353cf2f262ef8536f10 100644 (file)
@@ -33,7 +33,7 @@ Synopsis
 
 | **ceph** **log** *<logtext>* [ *<logtext>*... ]
 
-| **ceph** **mds** [ *add_data_pool* \| *cluster_down* \| *cluster_up* \| *compat* \| *deactivate* \| *dump* \| *fail* \| *getmap* \| *newfs* \| *remove_data_pool* \| *rm* \| *rmfailed* \| *set* \| *set_max_mds* \| *set_state* \| *setmap* \| *stat* \| *stop* \| *tell* ] ...
+| **ceph** **mds** [ *add_data_pool* \| *cluster_down* \| *cluster_up* \| *compat* \| *deactivate* \| *dump* \| *fail* \| *getmap* \| *newfs* \| *remove_data_pool* \| *rm* \| *rmfailed* \| *set* \| *set_max_mds* \| *set_state* \| *stat* \| *stop* \| *tell* ] ...
 
 | **ceph** **mon** [ *add* \| *dump* \| *getmap* \| *remove* \| *stat* ] ...
 
@@ -433,12 +433,6 @@ Usage::
 
        ceph mds set_state <int[0-]> <int[0-20]>
 
-Subcommand ``setmap`` sets mds map; must supply correct epoch number.
-
-Usage::
-
-       ceph mds setmap <int[0-]>
-
 Subcommand ``stat`` shows MDS status.
 
 Usage::
index a680be73c71550f61dd0d1198f44ec482a6fe2bc..c0440aa1f7cf454ca801ac786543dd0ae63b2dbc 100644 (file)
@@ -2135,35 +2135,6 @@ int MDSMonitor::filesystem_command(
         info->state = MDSMap::STATE_STOPPING;
       });
     }
-  } else if (prefix == "mds setmap") {
-    string confirm;
-    if (!cmd_getval(g_ceph_context, cmdmap, "confirm", confirm) ||
-       confirm != "--yes-i-really-mean-it") {
-      ss << "WARNING: this can make your filesystem inaccessible! "
-           "Add --yes-i-really-mean-it if you are sure you wish to continue.";
-      return -EINVAL;;
-    }
-    
-    FSMap map;
-    try {
-      map.decode(m->get_data());
-    } catch(buffer::error &e) {
-      ss << "invalid mdsmap";
-      return -EINVAL;
-    }
-    epoch_t e = 0;
-    int64_t epochnum;
-    if (cmd_getval(g_ceph_context, cmdmap, "epoch", epochnum))
-      e = epochnum;
-
-    if (pending_fsmap.epoch == e) {
-      map.epoch = pending_fsmap.epoch;  // make sure epoch is correct
-      pending_fsmap = map;
-      ss << "set mds map";
-    } else {
-      ss << "next fsmap epoch " << pending_fsmap.epoch << " != " << e;
-      return -EINVAL;
-    }
   } else if (prefix == "mds set_state") {
     mds_gid_t gid;
     if (!cmd_getval(g_ceph_context, cmdmap, "gid", gid)) {
index 59e7aed51f917db498d546caee14d560f5db525f..e92576086a8d249ca989f8187aac45f091a4a770 100644 (file)
@@ -329,10 +329,6 @@ COMMAND("mds set " \
        "name=val,type=CephString "                                     \
        "name=confirm,type=CephString,req=false",                       \
        "set mds parameter <var> to <val>", "mds", "rw", "cli,rest")
-COMMAND("mds setmap " \
-       "name=epoch,type=CephInt,range=0 " \
-       "name=confirm,type=CephString,req=false",
-       "set mds map; must supply correct epoch number", "mds", "rw", "cli,rest")
 // arbitrary limit 0-20 below; worth standing on head to make it
 // relate to actual state definitions?
 // #include "include/ceph_fs.h"
index d9b8b6259ac0170ff8f91deec8e029959c08beb5..a649731bfaf2e6faaa30822f483595cea5b6f5ce 100755 (executable)
@@ -380,17 +380,6 @@ class TestMDS(TestArgparse):
     def test_set_max_mds(self):
         self.check_1_natural_arg('mds', 'set_max_mds')
 
-    def test_setmap(self):
-        self.assert_valid_command(['mds', 'setmap', '1'])
-        self.assert_valid_command(['mds', 'setmap', '1', '--yes-i-really-mean-it'])
-        assert_equal({}, validate_command(sigdict, ['mds', 'setmap',
-                                                    '--yes-i-really-mean-it']))
-        assert_equal({}, validate_command(sigdict, ['mds', 'setmap', '-1',
-                                                    '--yes-i-really-mean-it']))
-        assert_equal({}, validate_command(sigdict, ['mds', 'setmap', '1',
-                                                    '--yes-i-really-mean-it',
-                                                    'toomany']))
-
     def test_set_state(self):
         self.assert_valid_command(['mds', 'set_state', '1', '2'])
         assert_equal({}, validate_command(sigdict, ['mds', 'set_state']))