Fix two other paths where may change the mon state so that we wait for the
pending write first. start_election() in particular can be triggered at
almost any time if we see an election message from another mon.
Signed-off-by: Sage Weil <sage@redhat.com>
void Monitor::join_election()
{
dout(10) << __func__ << dendl;
+ wait_for_paxos_write();
_reset();
state = STATE_ELECTING;
void Monitor::start_election()
{
dout(10) << "start_election" << dendl;
+ wait_for_paxos_write();
_reset();
state = STATE_ELECTING;
private:
void _reset(); ///< called from bootstrap, start_, or join_election
+ void wait_for_paxos_write();
public:
void bootstrap();
void join_election();