]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: remove the redundant is_active judge in PaxosService 9749/head
authorsongbaisen <song.baisen@zte.com.cn>
Thu, 16 Jun 2016 10:48:34 +0000 (18:48 +0800)
committersongbaisen <song.baisen@zte.com.cn>
Tue, 21 Jun 2016 02:45:24 +0000 (10:45 +0800)
Signed-off-by:song baisen <song.baisen@zte.com.cn>

src/mon/PaxosService.cc

index 0ab108694217113c79c4fd6dae2ecd39fe4af6c6..7c8ae8e5ad841b1c234dc58d96ce0bf1ae81913f 100644 (file)
@@ -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();
 }