ctdb-recoverd: Remote IP validation can't cause a takeover run
authorMartin Schwenke <martin@meltin.net>
Wed, 28 Oct 2015 09:33:29 +0000 (20:33 +1100)
committerAmitay Isaacs <amitay@samba.org>
Thu, 12 Nov 2015 05:24:15 +0000 (06:24 +0100)
Remote IP validation is only called when a takeover run is about to
happen anyway, so don't bother flagging one.  Given that a takeover
run isn't being triggered, also drop the test that checks if takeover
runs are disabled.  These are the only uses of the rec argument, so
drop it.

One possible further simplification would be to remove this function
because it doesn't accomplish anything.  However, it is worth leaving
it as a reminder that remote IP validation should be done properly at
some time in the future.

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

index 2e561f35032e23c574f7a66c05bf239fa0b6eae6..759b74a14a11215e2870a87c63f39bd3d6e12277 100644 (file)
@@ -1565,7 +1565,6 @@ static int recover_database(struct ctdb_recoverd *rec,
 }
 
 static int ctdb_reload_remote_public_ips(struct ctdb_context *ctdb,
-                                        struct ctdb_recoverd *rec,
                                         struct ctdb_node_map_old *nodemap)
 {
        int j;
@@ -1603,13 +1602,10 @@ static int ctdb_reload_remote_public_ips(struct ctdb_context *ctdb,
                        return -1;
                }
 
-               if (ctdb->do_checkpublicip &&
-                   !ctdb_op_is_disabled(rec->takeover_run) &&
-                   verify_remote_ip_allocation(ctdb,
-                                                node->known_public_ips,
-                                                node->pnn)) {
-                       DEBUG(DEBUG_ERR,("Trigger IP reallocation\n"));
-                       rec->need_takeover_run = true;
+               if (ctdb->do_checkpublicip) {
+                       verify_remote_ip_allocation(ctdb,
+                                                   node->known_public_ips,
+                                                   node->pnn);
                }
 
                /* Retrieve the list of available public IPs from the node */
@@ -2266,7 +2262,7 @@ static int do_recovery(struct ctdb_recoverd *rec,
        }
 
        /* Fetch known/available public IPs from each active node */
-       ret = ctdb_reload_remote_public_ips(ctdb, rec, nodemap);
+       ret = ctdb_reload_remote_public_ips(ctdb, nodemap);
        if (ret != 0) {
                rec->need_takeover_run = true;
                goto fail;
@@ -2797,7 +2793,7 @@ static void process_ipreallocate_requests(struct ctdb_context *ctdb,
        /* update the list of public ips that a node can handle for
           all connected nodes
        */
-       ret = ctdb_reload_remote_public_ips(ctdb, rec, rec->nodemap);
+       ret = ctdb_reload_remote_public_ips(ctdb, rec->nodemap);
        if (ret != 0) {
                rec->need_takeover_run = true;
        }
@@ -4010,7 +4006,7 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
                /* update the list of public ips that a node can handle for
                   all connected nodes
                */
-               ret = ctdb_reload_remote_public_ips(ctdb, rec, nodemap);
+               ret = ctdb_reload_remote_public_ips(ctdb, nodemap);
                if (ret != 0) {
                        return;
                }