summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2013-11-01 14:34:20 +1100
committerMichael Adam <obnox@samba.org>2013-11-27 18:46:16 +0100
commit6fbf399191cddbf87181f4cf837f352df5dbfa76 (patch)
treefdd7812549590391ffb285b94afe3615bc184993
parent2038d166ad0e283708e50378128671e985bcaed2 (diff)
ctdb-recoverd: A node refuses to play against itself
Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
-rw-r--r--ctdb/server/ctdb_recoverd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c
index 6d232e0706..d5b36acc19 100644
--- a/ctdb/server/ctdb_recoverd.c
+++ b/ctdb/server/ctdb_recoverd.c
@@ -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,