ctdb-ipalloc: Drop remote IP verification
authorMartin Schwenke <martin@meltin.net>
Mon, 20 Jun 2016 10:41:05 +0000 (20:41 +1000)
committerAmitay Isaacs <amitay@samba.org>
Mon, 4 Jul 2016 13:42:24 +0000 (15:42 +0200)
It is only run during a takeover run and only logs errors.  It doesn't
actually do anything to fix potential errors.  The takeover run should
fix any inconsistencies anyway.

Instead, leave a comment in the recovery daemon's monitoring loop to
add proper remote IP verification later.

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

index 01807b4e2be242f51c9ca9d7289951305d345dac..2d1b15da1bc58a77cabcf4c2d627c9bd60e17250 100644 (file)
@@ -3807,6 +3807,9 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
                }
        }
 
+       /* FIXME: Add remote public IP checking to ensure that nodes
+        * have the IP addresses that are allocated to them. */
+
 takeover_run_checks:
 
        /* If there are IP takeover runs requested or the previous one
index 8183784de98d721f17886c3b16a1c6d25fc2396a..9dfcc9ec4b65066af133ddd70c2f1f5521acdf3c 100644 (file)
@@ -1154,10 +1154,6 @@ static int getips_count_callback(void *param, void *data)
        return 0;
 }
 
-static int verify_remote_ip_allocation(struct ctdb_context *ctdb,
-                                      struct ctdb_public_ip_list *ips,
-                                      uint32_t pnn);
-
 static int ctdb_reload_remote_public_ips(struct ctdb_context *ctdb,
                                         struct ipalloc_state *ipalloc_state,
                                         struct ctdb_node_map_old *nodemap)
@@ -1199,13 +1195,6 @@ static int ctdb_reload_remote_public_ips(struct ctdb_context *ctdb,
                 * while anyway... */
                ipalloc_state->known_public_ips[j].ip = &ip_list->ips[0];
 
-               if (ctdb->do_checkpublicip) {
-                       verify_remote_ip_allocation(
-                               ctdb,
-                               &ipalloc_state->known_public_ips[j],
-                               j);
-               }
-
                /* Retrieve the list of available public IPs from the node */
                ret = ctdb_ctrl_get_public_ips_flags(ctdb,
                                        TAKEOVER_TIMEOUT(),
@@ -3019,51 +3008,6 @@ int32_t ctdb_control_ipreallocated(struct ctdb_context *ctdb,
 }
 
 
-/* This function is called from the recovery daemon to verify that a remote
-   node has the expected ip allocation.
-   This is verified against ctdb->ip_tree
-*/
-static int verify_remote_ip_allocation(struct ctdb_context *ctdb,
-                                      struct ctdb_public_ip_list *ips,
-                                      uint32_t pnn)
-{
-       struct public_ip_list *tmp_ip;
-       int i;
-
-       if (ctdb->ip_tree == NULL) {
-               /* don't know the expected allocation yet, assume remote node
-                  is correct. */
-               return 0;
-       }
-
-       if (ips == NULL) {
-               return 0;
-       }
-
-       for (i=0; i<ips->num; i++) {
-               tmp_ip = trbt_lookuparray32(ctdb->ip_tree, IP_KEYLEN, ip_key(&ips->ip[i].addr));
-               if (tmp_ip == NULL) {
-                       DEBUG(DEBUG_ERR,("Node %u has new or unknown public IP %s\n", pnn, ctdb_addr_to_str(&ips->ip[i].addr)));
-                       return -1;
-               }
-
-               if (tmp_ip->pnn == -1 || ips->ip[i].pnn == -1) {
-                       continue;
-               }
-
-               if (tmp_ip->pnn != ips->ip[i].pnn) {
-                       DEBUG(DEBUG_ERR,
-                             ("Inconsistent IP allocation - node %u thinks %s is held by node %u while it is assigned to node %u\n",
-                              pnn,
-                              ctdb_addr_to_str(&ips->ip[i].addr),
-                              ips->ip[i].pnn, tmp_ip->pnn));
-                       return -1;
-               }
-       }
-
-       return 0;
-}
-
 int update_ip_assignment_tree(struct ctdb_context *ctdb, struct ctdb_public_ip *ip)
 {
        struct public_ip_list *tmp_ip;