From: Sage Weil Date: Fri, 7 Jun 2013 18:07:38 +0000 (-0700) Subject: mon/Paxos: cleanup: drop unused PREPARING state bit X-Git-Tag: v0.66~47^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7b7ea8e30e20704caad9a841332ecb2e39819a41;p=ceph.git 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 --- diff --git a/src/mon/Paxos.cc b/src/mon/Paxos.cc index d76c715fe69a..9bd9726745ac 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(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 ff299106ece3..ac3c03478042 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: