summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoao Eduardo Luis <joao.luis@inktank.com>2013-05-22 13:59:08 +0100
committerJoao Eduardo Luis <joao.luis@inktank.com>2013-05-22 17:12:38 +0100
commite15d29094503f279d444eda246fc45c09f5535c9 (patch)
tree0d6e8fd8495743666f4fa7532c04f1a45e379ac1
parent586e8c2075f721456fbd40f738dab8ccfa657aa8 (diff)
downloadceph-e15d29094503f279d444eda246fc45c09f5535c9.tar.gz
mon: Paxos: get rid of the 'prepare_bootstrap()' mechanism
We don't need it after all. If we are in the middle of some proposal, then we guarantee that said proposal is likely to be retried. If we haven't yet proposed, then it's forever more likely that a client will eventually retry the message that triggered this proposal. Basically, this mechanism attempted at fixing a non-problem, and was in fact triggering some unforeseen issues that would have required increasing the code complexity for no good reason. Fixes: #5102 Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
-rw-r--r--src/mon/MonmapMonitor.cc2
-rw-r--r--src/mon/Paxos.cc16
-rw-r--r--src/mon/Paxos.h5
-rw-r--r--src/mon/PaxosService.h7
4 files changed, 4 insertions, 26 deletions
diff --git a/src/mon/MonmapMonitor.cc b/src/mon/MonmapMonitor.cc
index badac7e0922..d7472797f15 100644
--- a/src/mon/MonmapMonitor.cc
+++ b/src/mon/MonmapMonitor.cc
@@ -111,7 +111,7 @@ void MonmapMonitor::update_from_paxos()
}
if (need_restart) {
- paxos->prepare_bootstrap();
+ mon->bootstrap();
}
}
diff --git a/src/mon/Paxos.cc b/src/mon/Paxos.cc
index 1c2333c0949..bfb9ed4f5dd 100644
--- a/src/mon/Paxos.cc
+++ b/src/mon/Paxos.cc
@@ -37,13 +37,6 @@ static ostream& _prefix(std::ostream *_dout, Monitor *mon, const string& name,
<< ") ";
}
-void Paxos::prepare_bootstrap()
-{
- dout(0) << __func__ << dendl;
-
- going_to_bootstrap = true;
-}
-
MonitorDBStore *Paxos::get_store()
{
return mon->store;
@@ -836,12 +829,6 @@ void Paxos::finish_proposal()
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();
}
@@ -1097,8 +1084,6 @@ void Paxos::leader_init()
if (!proposals.empty())
finish_contexts(g_ceph_context, proposals, -EAGAIN);
- going_to_bootstrap = false;
-
if (mon->get_quorum().size() == 1) {
state = STATE_ACTIVE;
return;
@@ -1132,7 +1117,6 @@ void Paxos::restart()
new_value.clear();
state = STATE_RECOVERING;
- going_to_bootstrap = false;
if (!proposals.empty())
finish_contexts(g_ceph_context, proposals, -EAGAIN);
diff --git a/src/mon/Paxos.h b/src/mon/Paxos.h
index 2e1bb62dda9..160b02ecef2 100644
--- a/src/mon/Paxos.h
+++ b/src/mon/Paxos.h
@@ -530,7 +530,6 @@ private:
* @}
*/
- bool going_to_bootstrap;
/**
* Should be true if we have proposed to trim, or are in the middle of
* trimming; false otherwise.
@@ -1017,7 +1016,6 @@ public:
lease_timeout_event(0),
accept_timeout_event(0),
clock_drift_warned(0),
- going_to_bootstrap(false),
going_to_trim(false),
trim_disabled_version(0) { }
@@ -1025,9 +1023,6 @@ public:
return paxos_name;
}
- bool is_bootstrapping() { return going_to_bootstrap; }
- void prepare_bootstrap();
-
void dispatch(PaxosServiceMessage *m);
void reapply_all_versions();
diff --git a/src/mon/PaxosService.h b/src/mon/PaxosService.h
index 0e4c9e23b02..4de73ea4b19 100644
--- a/src/mon/PaxosService.h
+++ b/src/mon/PaxosService.h
@@ -498,8 +498,7 @@ public:
*/
bool is_active() {
return (!is_proposing() && !paxos->is_recovering()
- && !paxos->is_locked()
- && !paxos->is_bootstrapping());
+ && !paxos->is_locked());
}
/**
@@ -579,7 +578,7 @@ public:
* @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;
}
@@ -612,7 +611,7 @@ public:
* @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;
}