mon_caps = new MonCaps();
mon_caps->set_allow_all(true);
mon_caps->text = "allow *";
+
+ exited_quorum = ceph_clock_now(g_ceph_context);
}
Paxos *Monitor::add_paxos(int type)
{
dout(10) << "reset" << dendl;
leader_since = utime_t();
+ if (!quorum.empty()) {
+ exited_quorum = ceph_clock_now(g_ceph_context);
+ }
quorum.clear();
outside_quorum.clear();
void Monitor::finish_election()
{
+ exited_quorum = utime_t();
finish_contexts(g_ceph_context, waitfor_quorum);
resend_routed_requests();
update_logger();
<< " (until " << s->until << " < now " << now << ")" << dendl;
messenger->mark_down(s->inst.addr);
remove_session(s);
+ } else if (!exited_quorum.is_zero()) {
+ if (s->time_established < exited_quorum) {
+ if (now > (exited_quorum + 2 * g_conf->mon_lease)) {
+ // boot the client Session because we've taken too long getting back in
+ dout(10) << " trimming session " << s->inst
+ << " because we've been out of quorum too long" << dendl;
+ messenger->mark_down(s->inst.addr);
+ remove_session(s);
+ }
+ } else if (s->time_established + g_conf->mon_lease < now) {
+ dout(10) << " trimming session " << s->inst
+ << " because we're still not in quorum" << dendl;
+ messenger->mark_down(s->inst.addr);
+ remove_session(s);
+ }
}
}
int leader; // current leader (to best of knowledge)
set<int> quorum; // current active set of monitors (if !starting)
utime_t leader_since; // when this monitor became the leader, if it is the leader
+ utime_t exited_quorum; // time detected as not in quorum; 0 if in
set<string> outside_quorum;
entity_inst_t slurp_source;
Connection *con;
entity_inst_t inst;
utime_t until;
+ utime_t time_established;
bool closed;
xlist<MonSession*>::item item;
set<uint64_t> routed_request_tids;
MonSession(entity_inst_t i, Connection *c) :
con(c->get()), inst(i), closed(false), item(this),
global_id(0), notified_global_id(0), auth_handler(NULL),
- proxy_con(NULL), proxy_tid(0) {}
+ proxy_con(NULL), proxy_tid(0) {
+ time_established = ceph_clock_now(g_ceph_context);
+ }
~MonSession() {
if (con)
con->put();