diff options
author | Sage Weil <sage@inktank.com> | 2013-06-07 11:07:38 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-06-19 11:27:05 -0700 |
commit | 7b7ea8e30e20704caad9a841332ecb2e39819a41 (patch) | |
tree | 0dd1e94de2112757fe680b2447ad86f0a4ab2a9f | |
parent | f985de28f86675e974ac7842a49922a35fe24c6c (diff) | |
download | ceph-7b7ea8e30e20704caad9a841332ecb2e39819a41.tar.gz |
mon/Paxos: cleanup: drop unused PREPARING state bit
This is never set when we block, and nobody looks at it.
Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r-- | src/mon/Paxos.cc | 7 | ||||
-rw-r--r-- | src/mon/Paxos.h | 8 |
2 files changed, 2 insertions, 13 deletions
diff --git a/src/mon/Paxos.cc b/src/mon/Paxos.cc index d76c715fe69..9bd9726745a 100644 --- a/src/mon/Paxos.cc +++ b/src/mon/Paxos.cc @@ -431,7 +431,7 @@ void Paxos::handle_last(MMonPaxos *last) if (uncommitted_v == last_committed+1 && uncommitted_value.length()) { dout(10) << "that's everyone. begin on old learned value" << dendl; - state = STATE_PREPARING | STATE_LOCKED; + state = STATE_LOCKED; begin(uncommitted_value); } else { // active! @@ -470,8 +470,6 @@ void Paxos::begin(bufferlist& v) << dendl; assert(mon->is_leader()); - assert(is_preparing()); - state &= ~STATE_PREPARING; state |= STATE_UPDATING; // we must already have a majority for this to work. @@ -1252,8 +1250,6 @@ void Paxos::propose_queued() assert(is_active()); assert(!proposals.empty()); - state = STATE_PREPARING; - C_Proposal *proposal = static_cast<C_Proposal*>(proposals.front()); assert(!proposal->proposed); @@ -1266,6 +1262,7 @@ void Paxos::propose_queued() list_proposals(*_dout); *_dout << dendl; + state = 0; begin(proposal->bl); } diff --git a/src/mon/Paxos.h b/src/mon/Paxos.h index ff299106ece..ac3c0347804 100644 --- a/src/mon/Paxos.h +++ b/src/mon/Paxos.h @@ -175,10 +175,6 @@ public: * Leader/Peon is updating to a new value. */ const static int STATE_UPDATING = 0x04; - /** - * Leader is about to propose a new value, but hasn't gotten to do it yet. - */ - const static int STATE_PREPARING = 0x08; const static int STATE_LOCKED = 0x10; @@ -202,9 +198,6 @@ public: } else if (s & STATE_UPDATING) { ss << "updating"; assert(!(s & ~(STATE_UPDATING|STATE_LOCKED))); - } else if (s & STATE_PREPARING) { - ss << "preparing update"; - assert(!(s & ~(STATE_PREPARING|STATE_LOCKED))); } else { assert(0 == "We shouldn't have gotten here!"); } @@ -243,7 +236,6 @@ public: */ bool is_updating() const { return (state & STATE_UPDATING); } - bool is_preparing() const { return (state & STATE_PREPARING); } bool is_locked() const { return (state & STATE_LOCKED); } private: |