logger->inc(l_mon_num_elections);
logger->inc(l_mon_election_call);
- clog->info() << "mon." << name << " calling new monitor election";
+ clog->info() << "mon." << name << " calling monitor election";
elector.call_election();
}
pending_metadata = metadata;
outside_quorum.clear();
- clog->info() << "mon." << name << "@" << rank
- << " won leader election with quorum " << quorum;
+ clog->info() << "mon." << name << " is new leader, mons " << get_quorum_names()
+ << " in quorum (ranks " << quorum << ")";
set_leader_commands(get_local_commands(mon_features));
monmap->get_epoch() > 0) {
timecheck_start();
health_tick_start();
- do_health_to_clog_interval();
+
+ // Freshen the health status before doing health_to_clog in case
+ // our just-completed election changed the health
+ healthmon()->wait_for_active_ctx(new FunctionContext([this](int r){
+ dout(20) << "healthmon now active" << dendl;
+ healthmon()->tick();
+ if (healthmon()->is_proposing()) {
+ dout(20) << __func__ << " healthmon proposing, waiting" << dendl;
+ healthmon()->wait_for_finished_proposal(nullptr, new C_MonContext(this,
+ [this](int r){
+ assert(lock.is_locked_by_me());
+ do_health_to_clog_interval();
+ }));
+
+ } else {
+ do_health_to_clog_interval();
+ }
+ }));
+
scrub_event_start();
}
}
new C_MonContext(this, [this](int r) {
if (r < 0)
return;
- do_health_to_clog();
health_tick_start();
}));
}
ostringstream ss;
health_status_t status = timecheck_status(ss, skew_bound, latency);
- clog->health(status) << other << " " << ss.str();
+ if (status != HEALTH_OK) {
+ clog->health(status) << other << " " << ss.str();
+ }
dout(10) << __func__ << " from " << other << " ts " << m->timestamp
<< " delta " << delta << " skew_bound " << skew_bound