From: Sage Weil Date: Fri, 18 Nov 2011 17:49:03 +0000 (-0800) Subject: paxos: do not create_pending if !active X-Git-Tag: v0.39~36 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9800faeb9256dc86995b5603a2babdb71eef7ddc;p=ceph.git paxos: do not create_pending if !active This avoids a scenario like: - _active() - proposes value - _commit() - creates new pending, even though in updating state Signed-off-by: Sage Weil --- diff --git a/src/mon/PaxosService.cc b/src/mon/PaxosService.cc index d07637eead49..783af6797361 100644 --- a/src/mon/PaxosService.cc +++ b/src/mon/PaxosService.cc @@ -109,7 +109,7 @@ void PaxosService::_commit() dout(7) << "_commit" << dendl; update_from_paxos(); // notify service of new paxos state - if (mon->is_leader()) { + if (mon->is_leader() && paxos->is_active()) { dout(7) << "_commit creating new pending" << dendl; if (!have_pending) { create_pending(); @@ -180,7 +180,8 @@ void PaxosService::_active() update_from_paxos(); // create pending state? - if (mon->is_leader()) { + if (mon->is_leader() && paxos->is_active()) { + dout(7) << "_active creating new pending" << dendl; if (!have_pending) { create_pending(); have_pending = true;