From: Kefu Chai Date: Mon, 30 Oct 2017 06:28:34 +0000 (+0800) Subject: mon: remove unused waiting_for_commit X-Git-Tag: v13.0.1~237^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7489d0e6b55def2a3740f2a128a59bb226530c4e;p=ceph.git mon: remove unused waiting_for_commit we are using `pending_finishers` instead of it now. Signed-off-by: Kefu Chai --- diff --git a/src/mon/Paxos.cc b/src/mon/Paxos.cc index e92438769f0..ea2aeaf923d 100644 --- a/src/mon/Paxos.cc +++ b/src/mon/Paxos.cc @@ -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); diff --git a/src/mon/Paxos.h b/src/mon/Paxos.h index 896aafa07ea..f0db1006477 100644 --- a/src/mon/Paxos.h +++ b/src/mon/Paxos.h @@ -572,15 +572,6 @@ private: * not on the active state, or if the lease has expired. */ list 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 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); - } /** * @} */