ctdb-recoverd: Add new function clear_ip_assignment_tree()
authorMartin Schwenke <martin@meltin.net>
Thu, 11 Jun 2015 05:46:27 +0000 (15:46 +1000)
committerAmitay Isaacs <amitay@samba.org>
Wed, 1 Jul 2015 02:18:28 +0000 (04:18 +0200)
This needs to be cleared to avoid stale data when a new recovery
master is elected.

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

index b177d6dba8d84c8d28c68aec3b945487e51c25cc..4413a320166b437b5b0c4ce5d0b89928b6af9b08 100644 (file)
@@ -1395,11 +1395,12 @@ int ctdb_recheck_persistent_health(struct ctdb_context *ctdb);
 
 void ctdb_run_notification_script(struct ctdb_context *ctdb, const char *event);
 
-int verify_remote_ip_allocation(struct ctdb_context *ctdb, 
+int verify_remote_ip_allocation(struct ctdb_context *ctdb,
                                struct ctdb_all_public_ips *ips,
                                uint32_t pnn);
 int update_ip_assignment_tree(struct ctdb_context *ctdb,
                                struct ctdb_public_ip *ip);
+void clear_ip_assignment_tree(struct ctdb_context *ctdb);
 
 int ctdb_init_tevent_logging(struct ctdb_context *ctdb);
 
index 510c8835aaaf8a51be255da930ff6490baaf75b4..d5d2b39e4d8a7b080fdf3a96b0006669be6a0ded 100644 (file)
@@ -4262,6 +4262,10 @@ int update_ip_assignment_tree(struct ctdb_context *ctdb, struct ctdb_public_ip *
        return 0;
 }
 
+void clear_ip_assignment_tree(struct ctdb_context *ctdb)
+{
+       TALLOC_FREE(ctdb->ip_tree);
+}
 
 struct ctdb_reloadips_handle {
        struct ctdb_context *ctdb;