From 364b86813fe17cf96c404d6f9f46f438b0353770 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 13 Jan 2015 05:38:19 -0800 Subject: [PATCH] mon/Paxos: consolidate finish_round() Signed-off-by: Sage Weil --- src/mon/Paxos.cc | 25 ++++++++----------------- src/mon/Paxos.h | 8 -------- 2 files changed, 8 insertions(+), 25 deletions(-) diff --git a/src/mon/Paxos.cc b/src/mon/Paxos.cc index 2bd0893d210..297ea17ce07 100644 --- a/src/mon/Paxos.cc +++ b/src/mon/Paxos.cc @@ -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(); diff --git a/src/mon/Paxos.h b/src/mon/Paxos.h index 1bb710b4ccd..457c8af1d26 100644 --- a/src/mon/Paxos.h +++ b/src/mon/Paxos.h @@ -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 -- 2.47.3