summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-07-13 08:38:40 -0700
committerSage Weil <sage@inktank.com>2013-07-15 13:42:54 -0700
commiteac559f47460ff59b580862b89c7c4fe8c48e3ca (patch)
tree94bcfdcecaaa05f0f3eabf097c854dcac8e6b3b4
parentc67d50b86b939766f0d378e4334f177be815b6f8 (diff)
downloadceph-eac559f47460ff59b580862b89c7c4fe8c48e3ca.tar.gz
mon: drop win_election() _reset() kludge and strengthen assertions
This is only there for the benefit of win_standalone_election(), but it doesn't need it, it clutters the code, and weakens our assertions. Now the only win_election() callers are win_standalone_election() (which is a single path that just did _reset()) and from the elector. Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--src/mon/Monitor.cc11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc
index c801886eb45..b28a5c071ea 100644
--- a/src/mon/Monitor.cc
+++ b/src/mon/Monitor.cc
@@ -1457,20 +1457,15 @@ epoch_t Monitor::get_epoch()
void Monitor::win_election(epoch_t epoch, set<int>& active, uint64_t features)
{
- if (!is_electing()) {
- state = STATE_ELECTING;
- _reset();
- }
-
+ dout(10) << __func__ << " epoch " << epoch << " quorum " << active
+ << " features " << features << dendl;
+ assert(is_electing());
state = STATE_LEADER;
leader_since = ceph_clock_now(g_ceph_context);
leader = rank;
quorum = active;
quorum_features = features;
outside_quorum.clear();
- dout(10) << "win_election, epoch " << epoch << " quorum is " << quorum
- << " features are " << quorum_features
- << dendl;
clog.info() << "mon." << name << "@" << rank
<< " won leader election with quorum " << quorum << "\n";