We can adopt new monmaps while bootstrapping, or in election messages, in
addition to MonmapMonitor::update_from_paxos. Since we use the
notification to update our election strategy and such, we need to notify
from these locations as well!
Fixes: https://tracker.ceph.com/issues/47654
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
(cherry picked from commit
1d5f4e879e50a537ef6db51f7e519a03ab586cd5)
Fixes: https://tracker.ceph.com/issues/50087
mon->store->apply_transaction(t);
//mon->monmon()->paxos->stash_latest(mon->monmap->epoch, em->monmap_bl);
cancel_timer();
+ mon->notify_new_monmap(false);
mon->bootstrap();
return;
}
void notify_rank_changed(int new_rank);
/**
* A peer has been removed so we should clean up state related to it.
+ * This is safe to call even if we haven't joined or are currently
+ * in a quorum.
*/
void notify_rank_removed(int rank_removed);
void notify_strategy_maybe_changed(int strategy);
<< ", mine was " << monmap->get_epoch() << dendl;
delete newmap;
monmap->decode(m->monmap_bl);
+ notify_new_monmap(false);
bootstrap();
return;
return ret;
}
-void Monitor::notify_new_monmap()
+void Monitor::notify_new_monmap(bool can_change_external_state)
{
elector.notify_strategy_maybe_changed(monmap->strategy);
dout(30) << __func__ << "we have " << monmap->removed_ranks.size() << " removed ranks" << dendl;
set_degraded_stretch_mode();
}
}
- set_elector_disallowed_leaders(true);
+ set_elector_disallowed_leaders(can_change_external_state);
}
void Monitor::set_elector_disallowed_leaders(bool allow_election)
void waitlist_or_zap_client(MonOpRequestRef op);
void send_mon_message(Message *m, int rank);
- void notify_new_monmap();
+ /** can_change_external_state if we can do things like
+ * call elections as a result of the new map.
+ */
+ void notify_new_monmap(bool can_change_external_state=false);
public:
struct C_Command : public C_MonOp {
stringify(ceph_release()));
}
- mon.notify_new_monmap();
+ mon.notify_new_monmap(true);
}
void MonmapMonitor::create_pending()