1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-04 17:47:26 +03:00

ctdb-recoverd: Remote IP validation can't cause a takeover run

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>
This commit is contained in:
Martin Schwenke 2015-10-28 20:33:29 +11:00 committed by Amitay Isaacs
parent 8b7b153cf6
commit c37e3c05b0

View 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;
}