diff options
author | Sage Weil <sage@inktank.com> | 2013-06-07 11:07:38 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-06-24 16:16:41 -0700 |
commit | 10d41200622d76dbf276602828584e7153cb22b5 (patch) | |
tree | 212cd3f0d4c7ea916a98fa5065defd80e291bdf3 | |
parent | 9d7c40e3f4ea2dd969aa0264ea8a6ad74f3e678a (diff) | |
download | ceph-10d41200622d76dbf276602828584e7153cb22b5.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>
(cherry picked from commit 7b7ea8e30e20704caad9a841332ecb2e39819a41)
-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 243c878e1f9..7ce5f687066 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. @@ -1254,8 +1252,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); @@ -1268,6 +1264,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: |