OPTION(mon_osd_force_trim_to, OPT_INT, 0) // force mon to trim maps to this point, regardless of min_last_epoch_clean (dangerous, use with care)
OPTION(mon_mds_force_trim_to, OPT_INT, 0) // force mon to trim mdsmaps to this point (dangerous, use with care)
-OPTION(mon_advanced_debug_mode, OPT_BOOL, false) // true for developper oriented testing
// dump transactions
OPTION(mon_debug_dump_transactions, OPT_BOOL, false)
OPTION(mon_debug_dump_location, OPT_STR, "/var/log/ceph/$cluster-$name.tdump")
} else if (command.find("add_bootstrap_peer_hint") == 0) {
if (!_add_bootstrap_peer_hint(command, cmdmap, ss))
goto abort;
- } else if (command.find("osdmonitor_prepare_command") == 0) {
- if (!_osdmonitor_prepare_command(cmdmap, ss))
- goto abort;
} else if (command == "quorum enter") {
elector.start_participating();
start_election();
r = admin_socket->register_command("mon_status", "mon_status", admin_hook,
"show current monitor status");
assert(r == 0);
- if (g_conf->mon_advanced_debug_mode) {
- r = admin_socket->register_command("osdmonitor_prepare_command", "osdmonitor_prepare_command", admin_hook,
- "call OSDMonitor::prepare_command");
- assert(r == 0);
- }
r = admin_socket->register_command("quorum_status", "quorum_status",
admin_hook, "show current quorum status");
assert(r == 0);
}
}
-bool Monitor::_osdmonitor_prepare_command(cmdmap_t& cmdmap, ostream& ss)
-{
- if (!is_leader()) {
- ss << "mon must be a leader";
- return false;
- }
-
- string cmd;
- cmd_getval(g_ceph_context, cmdmap, "prepare", cmd);
- cmdmap["prefix"] = cmdmap["prepare"];
-
- OSDMonitor *monitor = osdmon();
- MMonCommand *m = static_cast<MMonCommand *>((new MMonCommand())->get());
- bool r = true;
- if (monitor->prepare_command_impl(m, cmdmap)) {
- ss << "true";
- } else {
- ss << "false";
- r = false;
- }
- m->put();
- return r;
-}
-
bool Monitor::_add_bootstrap_peer_hint(string cmd, cmdmap_t& cmdmap, ostream& ss)
{
string addrstr;
const MonCommand *this_cmd);
void get_mon_status(Formatter *f, ostream& ss);
void _quorum_status(Formatter *f, ostream& ss);
- bool _osdmonitor_prepare_command(cmdmap_t& cmdmap, ostream& ss);
bool _add_bootstrap_peer_hint(string cmd, cmdmap_t& cmdmap, ostream& ss);
void handle_command(class MMonCommand *m);
void handle_route(MRoute *m);