diff --git a/src/mon/MonCommands.h b/src/mon/MonCommands.h index 521b33f9749..86a3da4f3b1 100644 --- a/src/mon/MonCommands.h +++ b/src/mon/MonCommands.h @@ -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)) /* diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 5b8de257466..3f047c117b8 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -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();