]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mon: when electing, be sure acked leaders have new enough stores to lead 246/head
authorGreg Farnum <greg@inktank.com>
Wed, 24 Apr 2013 22:36:41 +0000 (15:36 -0700)
committerGreg Farnum <greg@inktank.com>
Wed, 24 Apr 2013 22:40:13 +0000 (15:40 -0700)
commitfcaabf1a22723c571c10d402464071c6405607c0
treecec304ff0cc9843f98d637adb55c820ee97c050f
parentfb8bad31056f40a3f3e5d6c7af43ec627904d75f
mon: when electing, be sure acked leaders have new enough stores to lead

In general anybody participating in an election should be new enough to
lead thanks to the bootstrap process, but we've observed situations in
which a monitor is leader but gets so busy that it gets booted out
without noticing for a while, then processes the election messages
which were spawned, responds to them, and the other monitors kick those
up to a new election epoch. Then the old and behind monitor gets
elected as the new leader, which does bad things to our sync.

To deal with this, add the paxos first and last committed versions
to the MMonElection messages, and consider those values when deciding
whether to defer to a peer. Only defer to them if their newest value
is newer than our oldest, but also *do* defer to them if their oldest
value is newer than our newest even if we out-rank them otherwise.

Signed-off-by: Greg Farnum <greg@inktank.com>
src/messages/MMonElection.h
src/mon/Elector.cc
src/mon/Elector.h