summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2011-11-18 09:49:03 -0800
committerSage Weil <sage@newdream.net>2011-11-18 09:49:03 -0800
commit9800faeb9256dc86995b5603a2babdb71eef7ddc (patch)
tree505f95315441f93c9d7182f1cec74555649246cf
parentfa5876870a2d5d0d514533e43359a77c8e115e6b (diff)
downloadceph-9800faeb9256dc86995b5603a2babdb71eef7ddc.tar.gz
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 <sage@newdream.net>
-rw-r--r--src/mon/PaxosService.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mon/PaxosService.cc b/src/mon/PaxosService.cc
index d07637eead4..783af679736 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;