From: Joao Eduardo Luis Date: Fri, 8 May 2015 23:14:40 +0000 (+0100) Subject: mon: Monitor: use 'ceph mon sync force' instead of 'ceph sync force' X-Git-Tag: v9.0.3~21^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=955dcede2a82c89e81ebc4fe42871b3038aabaea;p=ceph.git mon: Monitor: use 'ceph mon sync force' instead of 'ceph sync force' 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 --- diff --git a/src/mon/MonCommands.h b/src/mon/MonCommands.h index 86a3da4f3b1d..473c09a34114 100644 --- a/src/mon/MonCommands.h +++ b/src/mon/MonCommands.h @@ -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)) /* diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 3f047c117b81..df9e200993f5 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -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);