mirror of
https://github.com/samba-team/samba.git
synced 2025-02-28 01:58:17 +03:00
ctdb-ipalloc: Use a cumulative timeout for takeover run stages
RELEASE_IP sometimes times out because killing TCP connections can take a long time. The aim of the takeover timeout is actually to limit the total amount of time for an IP takeover run. So, calculate a combined timeout offset once and use it for each of the RELEASE_IP, TAKEOVER_IP, IPREALLOCATED stages. This gives RELEASE_IP more time to kill TCP connections but still limits the total time. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
parent
ff6a22757a
commit
c40fc62642
@ -1508,6 +1508,17 @@ int ctdb_takeover_run(struct ctdb_context *ctdb, struct ctdb_node_map_old *nodem
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Each of the later stages (RELEASE_IP, TAKEOVER_IP,
|
||||
* IPREALLOCATED) notionally has a timeout of TakeoverTimeout
|
||||
* seconds. However, RELEASE_IP can take longer due to TCP
|
||||
* connection killing, so sometimes needs more time.
|
||||
* Therefore, use a cumulative timeout of TakeoverTimeout * 3
|
||||
* seconds across all 3 stages. No explicit expiry checks are
|
||||
* needed before each stage because tevent is smart enough to
|
||||
* fire the timeouts even if they are in the past. Initialise
|
||||
* this here to cope with early jumps to IPREALLOCATED. */
|
||||
timeout = timeval_current_ofs(3 * ctdb->tunable.takeover_timeout,0);
|
||||
|
||||
/*
|
||||
* ip failover is completely disabled, just send out the
|
||||
* ipreallocated event.
|
||||
@ -1602,7 +1613,6 @@ int ctdb_takeover_run(struct ctdb_context *ctdb, struct ctdb_node_map_old *nodem
|
||||
ip.pnn = tmp_ip->pnn;
|
||||
ip.addr = tmp_ip->addr;
|
||||
|
||||
timeout = TAKEOVER_TIMEOUT();
|
||||
data.dsize = sizeof(ip);
|
||||
data.dptr = (uint8_t *)&ip;
|
||||
state = ctdb_control_send(ctdb, nodemap->nodes[i].pnn,
|
||||
@ -1645,7 +1655,6 @@ int ctdb_takeover_run(struct ctdb_context *ctdb, struct ctdb_node_map_old *nodem
|
||||
ip.pnn = tmp_ip->pnn;
|
||||
ip.addr = tmp_ip->addr;
|
||||
|
||||
timeout = TAKEOVER_TIMEOUT();
|
||||
data.dsize = sizeof(ip);
|
||||
data.dptr = (uint8_t *)&ip;
|
||||
state = ctdb_control_send(ctdb, tmp_ip->pnn,
|
||||
@ -1675,7 +1684,7 @@ ipreallocated:
|
||||
*/
|
||||
nodes = list_of_connected_nodes(ctdb, nodemap, tmp_ctx, true);
|
||||
ret = ctdb_client_async_control(ctdb, CTDB_CONTROL_IPREALLOCATED,
|
||||
nodes, 0, TAKEOVER_TIMEOUT(),
|
||||
nodes, 0, timeout,
|
||||
false, tdb_null,
|
||||
NULL, takeover_run_fail_callback,
|
||||
takeover_data);
|
||||
|
Loading…
x
Reference in New Issue
Block a user