mon: add 'mds rm <gid>' and 'mds rmfailed <id>' commands

For cleaning up the mds map when things get weird.

Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
Sage Weil 2010-10-17 20:04:32 -07:00
parent ce09cbdd94
commit 69b764a8d3

View File

@ -608,6 +608,26 @@ bool MDSMonitor::prepare_command(MMonCommand *m)
paxos->wait_for_commit(new Monitor::C_Command(mon, m, 0, rs, paxos->get_version()));
return true;
}
else if (m->cmd[1] == "rm" && m->cmd.size() == 3) {
uint64_t gid = atoll(m->cmd[2].c_str());
pending_mdsmap.mds_info.erase(gid);
stringstream ss;
ss << "removed mds gid " << gid;
string rs;
getline(ss, rs);
paxos->wait_for_commit(new Monitor::C_Command(mon, m, 0, rs, paxos->get_version()));
return true;
}
else if (m->cmd[1] == "rmfailed" && m->cmd.size() == 3) {
int w = atoi(m->cmd[2].c_str());
pending_mdsmap.failed.erase(w);
stringstream ss;
ss << "removed failed mds" << w;
string rs;
getline(ss, rs);
paxos->wait_for_commit(new Monitor::C_Command(mon, m, 0, rs, paxos->get_version()));
return true;
}
else if (m->cmd[1] == "compat" && m->cmd.size() == 4) {
uint64_t f = atoll(m->cmd[3].c_str());
if (m->cmd[2] == "rm_compat") {