]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: Monitor: use 'ceph mon sync force' instead of 'ceph sync force'
authorJoao Eduardo Luis <joao@suse.de>
Fri, 8 May 2015 23:14:40 +0000 (00:14 +0100)
committerJoao Eduardo Luis <joao@suse.de>
Thu, 16 Jul 2015 11:20:02 +0000 (12:20 +0100)
Makes it easier to identify the command as being related with the
monitor instead of cluster-wide.

This entails adding an exception to module 'mon' in order to have this
command handled by the Monitor class instead of MonmapMonitor (which is
the one traditionally handling 'mon' module commands).

Fixes: #11545
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
src/mon/MonCommands.h
src/mon/Monitor.cc

index 86a3da4f3b1da6df8521626c160c5393127a80ff..473c09a3411465d200026ab6d9ee116993376368 100644 (file)
@@ -285,6 +285,12 @@ COMMAND_WITH_FLAG("mon scrub",
     "scrub the monitor stores", \
     "mon", "rw", "cli,rest", \
     FLAG(NONE))
+COMMAND_WITH_FLAG("mon sync force " \
+    "name=validate1,type=CephChoices,strings=--yes-i-really-mean-it,req=false " \
+    "name=validate2,type=CephChoices,strings=--i-know-what-i-am-doing,req=false", \
+    "force sync of and clear monitor store", \
+    "mon", "rw", "cli,rest", \
+    FLAG(NOFORWARD))
 
 
 /*
index 3f047c117b819182ad6522eb1f0917c07fc0040d..df9e200993f561d96b21895383c369d1b93a5b49 100644 (file)
@@ -2696,9 +2696,11 @@ void Monitor::handle_command(MMonCommand *m)
       /* Let the Monitor class handle the following commands:
        *  'mon compact'
        *  'mon scrub'
+       *  'mon sync force'
        */
       prefix != "mon compact" &&
-      prefix != "mon scrub") {
+      prefix != "mon scrub" &&
+      prefix != "mon sync force") {
     monmon()->dispatch(m);
     return;
   }
@@ -2920,7 +2922,8 @@ void Monitor::handle_command(MMonCommand *m)
     rdata.append(ds);
     rs = "";
     r = 0;
-  } else if (prefix == "sync force") {
+  } else if (prefix == "sync force" ||
+             prefix == "mon sync force") {
     string validate1, validate2;
     cmd_getval(g_ceph_context, cmdmap, "validate1", validate1);
     cmd_getval(g_ceph_context, cmdmap, "validate2", validate2);