From: Martin Schwenke Date: Mon, 20 Jun 2016 10:41:05 +0000 (+1000) Subject: ctdb-ipalloc: Drop remote IP verification X-Git-Tag: tdb-1.3.10~550 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=35644d0d82da0f2c1341dcdf9bb7472c09a8c99d;p=thirdparty%2Fsamba.git ctdb-ipalloc: Drop remote IP verification 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 Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c index 01807b4e2be..2d1b15da1bc 100644 --- a/ctdb/server/ctdb_recoverd.c +++ b/ctdb/server/ctdb_recoverd.c @@ -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 diff --git a/ctdb/server/ctdb_takeover.c b/ctdb/server/ctdb_takeover.c index 8183784de98..9dfcc9ec4b6 100644 --- a/ctdb/server/ctdb_takeover.c +++ b/ctdb/server/ctdb_takeover.c @@ -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; inum; 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;