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@gmail.com>
Thu, 16 Jul 2015 04:30:49 +0000 (14:30 +1000)
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>
(Imported from commit 036c2a92438585ab6b99a22fcf67b67890c525f0)

include/ctdb_private.h
server/ctdb_takeover.c

index 30905ac0c70241e6f7e8fc2de5c651c2e5d05de0..f68ba60b2c5258766a232d2c97c26ef213bc6111 100644 (file)
@@ -1499,11 +1499,12 @@ void ctdb_run_notification_script(struct ctdb_context *ctdb, const char *event);
 
 void ctdb_fault_setup(void);
 
-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 caffd174fa8e9b2f7231294f1badfa003bce60af..29d54f2b175013dfac1677d3f6d0f5d1d2c66977 100644 (file)
@@ -4412,6 +4412,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;