}
if (need_restart) {
- paxos->prepare_bootstrap();
+ mon->bootstrap();
}
}
<< ") ";
}
-void Paxos::prepare_bootstrap()
-{
- dout(0) << __func__ << dendl;
-
- going_to_bootstrap = true;
-}
-
MonitorDBStore *Paxos::get_store()
{
return mon->store;
first_committed = get_store()->get(get_name(), "first_committed");
last_committed = get_store()->get(get_name(), "last_committed");
- if (proposals.empty() && going_to_bootstrap) {
- dout(0) << __func__ << " no more proposals; bootstraping." << dendl;
- mon->bootstrap();
- return;
- }
-
if (should_trim()) {
trim();
}
if (!proposals.empty())
finish_contexts(g_ceph_context, proposals, -EAGAIN);
- going_to_bootstrap = false;
-
if (mon->get_quorum().size() == 1) {
state = STATE_ACTIVE;
return;
new_value.clear();
state = STATE_RECOVERING;
- going_to_bootstrap = false;
if (!proposals.empty())
finish_contexts(g_ceph_context, proposals, -EAGAIN);
* @}
*/
- bool going_to_bootstrap;
/**
* Should be true if we have proposed to trim, or are in the middle of
* trimming; false otherwise.
lease_timeout_event(0),
accept_timeout_event(0),
clock_drift_warned(0),
- going_to_bootstrap(false),
going_to_trim(false),
trim_disabled_version(0) { }
return paxos_name;
}
- bool is_bootstrapping() { return going_to_bootstrap; }
- void prepare_bootstrap();
-
void dispatch(PaxosServiceMessage *m);
void reapply_all_versions();
*/
bool is_active() {
return (!is_proposing() && !paxos->is_recovering()
- && !paxos->is_locked()
- && !paxos->is_bootstrapping());
+ && !paxos->is_locked());
}
/**
* @param c The callback to be awaken once we become active.
*/
void wait_for_active(Context *c) {
- if (paxos->is_bootstrapping() || !is_proposing()) {
+ if (!is_proposing()) {
paxos->wait_for_active(c);
return;
}
* @param c The callback to be awaken once we become writeable.
*/
void wait_for_writeable(Context *c) {
- if (paxos->is_bootstrapping() || !is_proposing()) {
+ if (!is_proposing()) {
paxos->wait_for_writeable(c);
return;
}