]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: remove unused waiting_for_commit
authorKefu Chai <kchai@redhat.com>
Mon, 30 Oct 2017 06:28:34 +0000 (14:28 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 30 Oct 2017 06:30:54 +0000 (14:30 +0800)
we are using `pending_finishers` instead of it now.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mon/Paxos.cc
src/mon/Paxos.h

index e92438769f088a910be5e7c6097e8a19e31caad3..ea2aeaf923d643facbd145a6a8fbf9e1f22bc457 100644 (file)
@@ -936,8 +936,6 @@ void Paxos::commit_finish()
       extend_lease();
     }
 
-    finish_contexts(g_ceph_context, waiting_for_commit);
-
     assert(g_conf->paxos_kill_at != 10);
 
     finish_round();
@@ -962,9 +960,7 @@ void Paxos::handle_commit(MonOpRequestRef op)
   op->mark_paxos_event("store_state");
   store_state(commit);
 
-  if (do_refresh()) {
-    finish_contexts(g_ceph_context, waiting_for_commit);
-  }
+  (void)do_refresh();
 }
 
 void Paxos::extend_lease()
@@ -1330,7 +1326,6 @@ void Paxos::shutdown()
     shutdown_cond.Wait(mon->lock);
 
   finish_contexts(g_ceph_context, waiting_for_writeable, -ECANCELED);
-  finish_contexts(g_ceph_context, waiting_for_commit, -ECANCELED);
   finish_contexts(g_ceph_context, waiting_for_readable, -ECANCELED);
   finish_contexts(g_ceph_context, waiting_for_active, -ECANCELED);
   finish_contexts(g_ceph_context, pending_finishers, -ECANCELED);
@@ -1381,7 +1376,6 @@ void Paxos::peon_init()
 
   // no chance to write now!
   finish_contexts(g_ceph_context, waiting_for_writeable, -EAGAIN);
-  finish_contexts(g_ceph_context, waiting_for_commit, -EAGAIN);
   finish_contexts(g_ceph_context, pending_finishers, -EAGAIN);
   finish_contexts(g_ceph_context, committing_finishers, -EAGAIN);
 
@@ -1408,7 +1402,6 @@ void Paxos::restart()
 
   finish_contexts(g_ceph_context, committing_finishers, -EAGAIN);
   finish_contexts(g_ceph_context, pending_finishers, -EAGAIN);
-  finish_contexts(g_ceph_context, waiting_for_commit, -EAGAIN);
   finish_contexts(g_ceph_context, waiting_for_active, -EAGAIN);
 
   logger->inc(l_paxos_restart);
index 896aafa07eaf1a714c8adac57ae2300399278aa8..f0db10064777689e04f84532fa4818591b04bda3 100644 (file)
@@ -572,15 +572,6 @@ private:
    *         not on the active state, or if the lease has expired.
    */
   list<Context*> waiting_for_writeable;
-  /**
-   * List of callbacks waiting for a commit to finish.
-   *
-   * @remarks This may be used to a) wait for an on-going commit to finish
-   *         before we proceed with, say, a new proposal; or b) wait for the
-   *         next commit to be finished so we are sure that our value was
-   *         fully committed.
-   */
-  list<Context*> waiting_for_commit;
 
   /**
    * Pending proposal transaction
@@ -1359,25 +1350,6 @@ public:
    * something) that will be deferred (e.g., until the current round finishes).
    */
   bool trigger_propose();
-
-  /**
-   * Add oncommit to the back of the list of callbacks waiting for us to
-   * finish committing.
-   *
-   * @param oncommit A callback
-   */
-  void wait_for_commit(Context *oncommit) {
-    waiting_for_commit.push_back(oncommit);
-  }
-  /**
-   * Add oncommit to the front of the list of callbacks waiting for us to
-   * finish committing.
-   *
-   * @param oncommit A callback
-   */
-  void wait_for_commit_front(Context *oncommit) {
-    waiting_for_commit.push_front(oncommit);
-  }
   /**
    * @}
    */