OPTION(mon_globalid_prealloc, OPT_INT, 100) // how many globalids to prealloc
OPTION(mon_osd_report_timeout, OPT_INT, 900) // grace period before declaring unresponsive OSDs dead
OPTION(mon_force_standby_active, OPT_BOOL, true) // should mons force standby-replay mds to be active
+OPTION(mon_warn_on_old_mons, OPT_BOOL, true) // should mons set health to WARN if part of quorum is old?
OPTION(mon_min_osdmap_epochs, OPT_INT, 500)
OPTION(mon_max_pgmap_epochs, OPT_INT, 500)
OPTION(mon_max_log_epochs, OPT_INT, 500)
// decide what command set we're supporting
bool use_classic_commands = !classic_mons.empty();
+ // keep a copy to share with the monitor; we clear classic_mons in bump_epoch
+ set<int> copy_classic_mons = classic_mons;
cancel_timer();
}
// tell monitor
- mon->win_election(epoch, quorum, features, cmds, cmdsize);
+ mon->win_election(epoch, quorum, features, cmds, cmdsize, ©_classic_mons);
}
const MonCommand *my_cmds;
int cmdsize;
get_locally_supported_monitor_commands(&my_cmds, &cmdsize);
- win_election(1, q, CEPH_FEATURES_ALL, my_cmds, cmdsize);
+ win_election(1, q, CEPH_FEATURES_ALL, my_cmds, cmdsize, NULL);
}
const utime_t& Monitor::get_leader_since() const
}
void Monitor::win_election(epoch_t epoch, set<int>& active, uint64_t features,
- const MonCommand *cmdset, int cmdsize)
+ const MonCommand *cmdset, int cmdsize,
+ const set<int> *classic_monitors)
{
dout(10) << __func__ << " epoch " << epoch << " quorum " << active
<< " features " << features << dendl;
<< " won leader election with quorum " << quorum << "\n";
set_leader_supported_commands(cmdset, cmdsize);
+ if (classic_monitors)
+ classic_mons = *classic_monitors;
paxos->leader_init();
for (vector<PaxosService*>::iterator p = paxos_service.begin(); p != paxos_service.end(); ++p)
uint64_t quorum_features; ///< intersection of quorum member feature bits
bufferlist supported_commands_bl; // encoded MonCommands we support
bufferlist classic_commands_bl; // encoded MonCommands supported by Dumpling
+ set<int> classic_mons; // set of "classic" monitors; only valid on leader
set<string> outside_quorum;
// end election (called by Elector)
void win_election(epoch_t epoch, set<int>& q,
uint64_t features,
- const MonCommand *cmdset, int cmdsize);
+ const MonCommand *cmdset, int cmdsize,
+ const set<int> *classic_monitors);
void lose_election(epoch_t epoch, set<int>& q, int l,
uint64_t features); // end election (called by Elector)
void finish_election();
const bufferlist& get_classic_commands_bl() {
return classic_commands_bl;
}
+ const set<int>& get_classic_mons() {
+ return classic_mons;
+ }
void update_logger();
}
}
}
+ if (g_conf->mon_warn_on_old_mons && !mon->get_classic_mons().empty()) {
+ ostringstream ss;
+ ss << "some monitors are running older code";
+ summary.push_back(make_pair(HEALTH_WARN, ss.str()));
+ if (detail) {
+ for (set<int>::const_iterator i = mon->get_classic_mons().begin();
+ i != mon->get_classic_mons().end();
+ ++i) {
+ ostringstream ss;
+ ss << "mon." << mon->monmap->get_name(*i)
+ << " only supports the \"classic\" command set";
+ detail->push_back(make_pair(HEALTH_WARN, ss.str()));
+ }
+ }
+ }
}
int MonmapMonitor::get_monmap(bufferlist &bl)