From 0a6904c8f305083271f42efc36b1d90d1a894c23 Mon Sep 17 00:00:00 2001 From: songbaisen Date: Thu, 16 Jun 2016 18:48:34 +0800 Subject: [PATCH] mon: remove the redundant is_active judge in PaxosService Signed-off-by:song baisen --- src/mon/PaxosService.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/mon/PaxosService.cc b/src/mon/PaxosService.cc index 0ab10869421..7c8ae8e5ad8 100644 --- a/src/mon/PaxosService.cc +++ b/src/mon/PaxosService.cc @@ -254,7 +254,7 @@ void PaxosService::_active() dout(10) << "_active" << dendl; // create pending state? - if (mon->is_leader() && is_active()) { + if (mon->is_leader()) { dout(7) << "_active creating new pending" << dendl; if (!have_pending) { create_pending(); @@ -270,8 +270,6 @@ void PaxosService::_active() } else { if (!mon->is_leader()) { dout(7) << __func__ << " we are not the leader, hence we propose nothing!" << dendl; - } else if (!is_active()) { - dout(7) << __func__ << " we are not active, hence we propose nothing!" << dendl; } } @@ -280,13 +278,12 @@ void PaxosService::_active() // on this list; it is on Paxos's. finish_contexts(g_ceph_context, waiting_for_finished_proposal, 0); - if (is_active() && mon->is_leader()) + if (mon->is_leader()) upgrade_format(); // NOTE: it's possible that this will get called twice if we commit // an old paxos value. Implementations should be mindful of that. - if (is_active()) - on_active(); + on_active(); } -- 2.47.3