]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/Paxos: cleanup: drop unused PREPARING state bit
authorSage Weil <sage@inktank.com>
Fri, 7 Jun 2013 18:07:38 +0000 (11:07 -0700)
committerSage Weil <sage@inktank.com>
Wed, 19 Jun 2013 18:27:05 +0000 (11:27 -0700)
This is never set when we block, and nobody looks at it.

Signed-off-by: Sage Weil <sage@inktank.com>
src/mon/Paxos.cc
src/mon/Paxos.h

index d76c715fe69ae8ab513cc2c86532ce6f23f71132..9bd9726745ac2455bc8a69ff7fb1380b2e125cae 100644 (file)
@@ -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);
 }
 
index ff299106ece37fd5ed9e5a9cf4b5ac2a58af1cd9..ac3c0347804247f30b2e34972c31c5e6b2b676a0 100644 (file)
@@ -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: