The REFRESH state is not readable; that's when we are re-reading our state
out of leveldb, and we hold the mon_lock during the period. So, strictly
speaking, it doesn't matter whether we include it here since none of these
call sites would be visited while in that state.
Signed-off-by: Sage Weil <sage@redhat.com>
dout(1) << "accept timeout, calling fresh election" << dendl;
accept_timeout_event = 0;
assert(mon->is_leader());
- assert(is_updating() || is_updating_previous());
+ assert(is_updating() || is_updating_previous() || is_writing());
logger->inc(l_paxos_accept_timeout);
mon->bootstrap();
}
return false;
return
(mon->is_peon() || mon->is_leader()) &&
- (is_active() || is_updating()) &&
+ (is_active() || is_updating() || is_writing()) &&
last_committed > 0 && // must have a value
(mon->get_quorum().size() == 1 || // alone, or
is_lease_valid()); // have lease
bool is_active() {
return
!is_proposing() &&
- (paxos->is_active() || paxos->is_updating());
+ (paxos->is_active() || paxos->is_updating() || paxos->is_writing());
}
/**
*
* - we are not proposing a new version;
* - we are ready to be written to -- i.e., we have a pending value.
- * - paxos is (active or updating)
+ * - paxos is (active or updating or writing or refresh)
*
* @returns true if writeable; false otherwise
*/
return
!is_proposing() &&
is_write_ready() &&
- (paxos->is_active() || paxos->is_updating());
+ (paxos->is_active() || paxos->is_updating() || paxos->is_writing());
}
/**