recoverd: Clear IP assignment tree on election loss
authorMartin Schwenke <martin@meltin.net>
Thu, 11 Jun 2015 05:49:25 +0000 (15:49 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Thu, 16 Jul 2015 04:31:41 +0000 (14:31 +1000)
If a node was previously recovery master (say, 20 years ago) and it
becomes recovery master again then, if IP assignments have changed,
verify_remote_ip_allocation() can produce messages like the following
when called during recovery:

  ctdbd: recoverd:Inconsistent IP allocation - node 0 thinks 10.1.1.1 is held by node 0 while it is assigned to node 1

When a node loses an election it should clear all data specific to it
being the recovery master.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit b234ae0a900052b03ca22efab8fa1b9e11f44ecc)

server/ctdb_recoverd.c

index 793ef1f80ff11c7f0c356bdcf3a5a734de16cc6c..650af2f9edb9b7d5f8d3700224be3f6be479ed4f 100644 (file)
@@ -2742,6 +2742,8 @@ static void election_handler(struct ctdb_context *ctdb, uint64_t srvid,
                }
        }
 
+       clear_ip_assignment_tree(ctdb);
+
        /* ok, let that guy become recmaster then */
        ret = ctdb_ctrl_setrecmaster(ctdb, CONTROL_TIMEOUT(), ctdb_get_pnn(ctdb), em->pnn);
        if (ret != 0) {