]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: Monitor: use 'ceph mon scrub' instead of 'ceph scrub'
authorJoao Eduardo Luis <joao@suse.de>
Fri, 8 May 2015 23:11:20 +0000 (00:11 +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 521b33f9749a04faa477617ac8bb6171af3997d0..86a3da4f3b1da6df8521626c160c5393127a80ff 100644 (file)
@@ -281,6 +281,10 @@ COMMAND_WITH_FLAG("mon compact", \
     "cause compaction of monitor's leveldb storage", \
     "mon", "rw", "cli,rest", \
     FLAG(NOFORWARD))
+COMMAND_WITH_FLAG("mon scrub",
+    "scrub the monitor stores", \
+    "mon", "rw", "cli,rest", \
+    FLAG(NONE))
 
 
 /*
index 5b8de2574668c7957cfd2ca1bd07d38955e4d547..3f047c117b819182ad6522eb1f0917c07fc0040d 100644 (file)
@@ -2693,8 +2693,12 @@ void Monitor::handle_command(MMonCommand *m)
     return;
   }
   if (module == "mon" &&
-      /* 'mon compact' will be handled by the Monitor class */
-      prefix != "mon compact") {
+      /* Let the Monitor class handle the following commands:
+       *  'mon compact'
+       *  'mon scrub'
+       */
+      prefix != "mon compact" &&
+      prefix != "mon scrub") {
     monmon()->dispatch(m);
     return;
   }
@@ -2726,7 +2730,7 @@ void Monitor::handle_command(MMonCommand *m)
     return;
   }
 
-  if (prefix == "scrub") {
+  if (prefix == "scrub" || prefix == "mon scrub") {
     wait_for_paxos_write();
     if (is_leader()) {
       int r = scrub();