[Linux-ha-dev] confused about the bully election algorithm
implementation in crmd
Andrew Beekhof
beekhof at gmail.com
Tue Dec 26 03:56:49 MST 2006
On 12/26/06, home_king <home_king at 163.com> wrote:
> Hi, all.
>
> I have two problems about the election.
>
> First, accrodding to the statement in fsa_defines.h,
> "N sends ELECTION messages to all nodes that occur earlier in
> the CCM's membership list."
> However, in fact, the code broadcasts VOTE messages to all the other
> members, in regradless of the (born-on) priority. Why?
>
> Second, it seems there exists a bug in the code: some node may take
> part in the election when it receives a VOTE message from its neighbour,
> which owns a low priority (the receiver win over the sender), and it will
> ignores the VOTE of neighbour and broadcast out its own VOTE message,
> right?
>
> I notices that meanwhile it will destroy the "voted" hash-table, which
> records the votes for itself from others. Here problem comes: what about
> the node launchs the VOTE twice in non-atomic manner? If thus,
> the two VOTE's NO-VOTE messages will mix up in the "voted" and
> do_election_count_vote() do not filter out the NO-VOTE messages with
> old "current_election_id" (Instead, it just logs an error).
what does the error look like?
> Given 3 nodes, node3 is DC.
> node3 performs slowly for some reason, and then node1 broadcasts a VOTE.
> node2's priority is higher than node1, so it sends out its VOTEs to
> node1 & node3, so does node3.
>
> NOVOTE from node2 is receviced by node3, the size of "voted" becomes 1.
> However, befores receiving the NOVOTE from node1, the node3 launchs
> another VOTE and zero the "voted"! Because it receives the VOTE from
> node2. Now three NOVOTE messages will come later! But two NOVOTE is
> enough to make node3 quits the S_ELECTION. The redundant NOVOTE will
> stay in the new "voted" lonely and infects the later elections.
>
> why?
probably because i messed up.
there were reasons (that i no longer clearly recall) why the algorithm
is no longer a pure bully election.
how repeatable is this problem?
if you can provide the logs for this it may also help me.
More information about the Linux-HA-Dev
mailing list