recoverd: A node refuses to play against itself
authorMartin Schwenke <martin@meltin.net>
Fri, 1 Nov 2013 03:34:20 +0000 (14:34 +1100)
committerMartin Schwenke <martin@meltin.net>
Thu, 14 Nov 2013 03:42:29 +0000 (14:42 +1100)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

server/ctdb_recoverd.c

index 6d232e07066a144b6350a97de3c31a7184ff6557..d5b36acc19a04d341e1f617fa5601de652bc002c 100644 (file)
@@ -2643,6 +2643,11 @@ static void election_handler(struct ctdb_context *ctdb, uint64_t srvid,
        struct election_message *em = (struct election_message *)data.dptr;
        TALLOC_CTX *mem_ctx;
 
+       /* Ignore election packets from ourself */
+       if (ctdb->pnn == em->pnn) {
+               return;
+       }
+
        /* we got an election packet - update the timeout for the election */
        talloc_free(rec->election_timeout);
        rec->election_timeout = event_add_timed(ctdb->ev, ctdb,