ctdb-recoverd: Get rid of connected-ness comparison in election
authorAmitay Isaacs <amitay@gmail.com>
Tue, 6 Oct 2015 03:46:48 +0000 (14:46 +1100)
committerAmitay Isaacs <amitay@samba.org>
Wed, 7 Oct 2015 12:53:29 +0000 (14:53 +0200)
The reason for favouring more connected node is to create a larger
cluster in case of a split brain.  In split brain condition, the nodes
are not communicating across partitions and each partition will run its
own election.  Among all the partitions, the node which holds the recovery
lock will eventually "win".  All the other nodes which won election but
could not grab recovery lock will end up banning themselves.

This also prevents the recovery master role from bouncing between nodes
during startup when the entire cluster is restarted.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/server/ctdb_recoverd.c

index d5f0fd6a1cd71dd0a658ebaf6972e49aca8e71b6..3c7f7f449cf14b1b8ae28564c7f32c479883a6d3 100644 (file)
@@ -2400,11 +2400,6 @@ static bool ctdb_election_win(struct ctdb_recoverd *rec, struct election_message
                return true;
        }
 
-       /* try to use the most connected node */
-       if (cmp == 0) {
-               cmp = (int)myem.num_connected - (int)em->num_connected;
-       }
-
        /* then the longest running node */
        if (cmp == 0) {
                cmp = timeval_compare(&em->priority_time, &myem.priority_time);