]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mon: move election start reset to starting_election() helper
authorSage Weil <sage@newdream.net>
Wed, 22 Sep 2010 18:31:12 +0000 (11:31 -0700)
committerSage Weil <sage@newdream.net>
Wed, 22 Sep 2010 19:09:09 +0000 (12:09 -0700)
commita783f409e5e5524b4f2c15f78c716ca77e8aeb3c
treed0a092b8216c30bd735462434e7913f5d1c76df8
parent6efd1e8acdf4ee05aa8a5cfb914ec1e48b0b9bec
mon: move election start reset to starting_election() helper

An election can start either because we call it, or because someone else
calls it.  Either way, we need to reset our state, so move that code into
the election_starting() callback, which is called by the elector's
start()/call_election() anyway.

This hopefully fixes a case where we see a timeout expire on the monitor
and fail the assertion

mon/Paxos.cc: In function 'void Paxos::lease_timeout()':
mon/Paxos.cc:684: FAILED assert(mon->is_peon())
 1: (SafeTimer::EventWrapper::finish(int)+0x259) [0x52da29]
 2: (Timer::timer_entry()+0x8e3) [0x52f523]
 3: (Timer::TimerThread::entry()+0xd) [0x46d45d]
 4: (Thread::_entry_func(void*)+0xa) [0x458aca]
 5: (()+0x6a3a) [0x7fe0bd6a4a3a]
 6: (clone()+0x6d) [0x7fe0bc8c277d]

The Paxos::election_starting() hook resets the timer, and will at least
close this possible cause.

Reported-by: Henry C Chang <henry_c_chang@tcloudcomputing.com>
Signed-off-by: Sage Weil <sage@newdream.net>
src/mon/Monitor.cc