]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/Paxos: consolidate finish_round() 3358/head
authorSage Weil <sage@redhat.com>
Tue, 13 Jan 2015 13:38:19 +0000 (05:38 -0800)
committerSage Weil <sage@redhat.com>
Tue, 13 Jan 2015 22:51:22 +0000 (14:51 -0800)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/Paxos.cc
src/mon/Paxos.h

index 2bd0893d21042561357ae8bed0fbe64de2e6fd75..297ea17ce075a78ca8399a64ccaa9ef36c951241 100644 (file)
@@ -568,12 +568,6 @@ void Paxos::handle_last(MMonPaxos *last)
        need_refresh = false;
        if (do_refresh()) {
          finish_round();
-
-         finish_contexts(g_ceph_context, waiting_for_active);
-         finish_contexts(g_ceph_context, waiting_for_readable);
-         finish_contexts(g_ceph_context, waiting_for_writeable);
-
-          maybe_propose_pending();
        }
       }
     }
@@ -917,13 +911,6 @@ void Paxos::commit_finish()
     assert(g_conf->paxos_kill_at != 10);
 
     finish_round();
-
-    // wake (other) people up
-    finish_contexts(g_ceph_context, waiting_for_active);
-    finish_contexts(g_ceph_context, waiting_for_readable);
-    finish_contexts(g_ceph_context, waiting_for_writeable);
-
-    maybe_propose_pending();
   }
 }
 
@@ -1051,11 +1038,15 @@ void Paxos::finish_round()
 
   // ok, now go active!
   state = STATE_ACTIVE;
-}
 
-void Paxos::maybe_propose_pending()
-{
-  dout(10) << __func__ << " state " << state << dendl;
+  dout(20) << __func__ << " waiting_for_acting" << dendl;
+  finish_contexts(g_ceph_context, waiting_for_active);
+  dout(20) << __func__ << " waiting_for_readable" << dendl;
+  finish_contexts(g_ceph_context, waiting_for_readable);
+  dout(20) << __func__ << " waiting_for_writeable" << dendl;
+  finish_contexts(g_ceph_context, waiting_for_writeable);
+  
+  dout(10) << __func__ << " done w/ waiters, state " << state << dendl;
 
   if (should_trim()) {
     trim();
index 1bb710b4ccdaa87a532c6c346099512e46521534..457c8af1d267fd0a187dee282b3e2980adc4c9fc 100644 (file)
@@ -1081,14 +1081,6 @@ private:
   void commit_proposal();
   void finish_round();
 
-  /**
-   * propose pending, if any
-   *
-   * This is called at the end of the round to check if there is another
-   * pending proposal ready to go.
-   */
-  void maybe_propose_pending();
-
 public:
   /**
    * @param m A monitor