mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
ctdb-ipalloc: Add no_ip_failback to ipalloc_state
The IP allocation algorithms need the value of this tunable, so copy it to avoid needing the CTDB context. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
parent
47ddd62358
commit
cc1637b17c
@ -67,6 +67,7 @@ struct ipalloc_state {
|
|||||||
struct ctdb_public_ip_list_old **available_public_ips;
|
struct ctdb_public_ip_list_old **available_public_ips;
|
||||||
|
|
||||||
enum ipalloc_algorithm algorithm;
|
enum ipalloc_algorithm algorithm;
|
||||||
|
uint32_t no_ip_failback;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ctdb_interface {
|
struct ctdb_interface {
|
||||||
@ -2107,7 +2108,7 @@ static void ip_alloc_deterministic_ips(struct ctdb_context *ctdb,
|
|||||||
* IPs, since the modulo step above implicitly fails
|
* IPs, since the modulo step above implicitly fails
|
||||||
* back IPs to their "home" node.
|
* back IPs to their "home" node.
|
||||||
*/
|
*/
|
||||||
if (1 == ctdb->tunable.no_ip_failback) {
|
if (1 == ctdb->ipalloc_state->no_ip_failback) {
|
||||||
DEBUG(DEBUG_WARNING, ("WARNING: 'NoIPFailback' set but ignored - incompatible with 'DeterministicIPs\n"));
|
DEBUG(DEBUG_WARNING, ("WARNING: 'NoIPFailback' set but ignored - incompatible with 'DeterministicIPs\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2134,7 +2135,7 @@ static void ip_alloc_nondeterministic_ips(struct ctdb_context *ctdb,
|
|||||||
basic_allocate_unassigned(ctdb, ipflags, all_ips);
|
basic_allocate_unassigned(ctdb, ipflags, all_ips);
|
||||||
|
|
||||||
/* If we don't want IPs to fail back then don't rebalance IPs. */
|
/* If we don't want IPs to fail back then don't rebalance IPs. */
|
||||||
if (1 == ctdb->tunable.no_ip_failback) {
|
if (1 == ctdb->ipalloc_state->no_ip_failback) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2163,7 +2164,7 @@ static void ip_alloc_lcp2(struct ctdb_context *ctdb,
|
|||||||
lcp2_allocate_unassigned(ctdb, ipflags, all_ips, lcp2_imbalances);
|
lcp2_allocate_unassigned(ctdb, ipflags, all_ips, lcp2_imbalances);
|
||||||
|
|
||||||
/* If we don't want IPs to fail back then don't rebalance IPs. */
|
/* If we don't want IPs to fail back then don't rebalance IPs. */
|
||||||
if (1 == ctdb->tunable.no_ip_failback) {
|
if (1 == ctdb->ipalloc_state->no_ip_failback) {
|
||||||
goto finished;
|
goto finished;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2482,6 +2483,8 @@ static struct ipalloc_state * ipalloc_state_init(struct ctdb_context *ctdb,
|
|||||||
ipalloc_state->algorithm = IPALLOC_NONDETERMINISTIC;
|
ipalloc_state->algorithm = IPALLOC_NONDETERMINISTIC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ipalloc_state->no_ip_failback = ctdb->tunable.no_ip_failback;
|
||||||
|
|
||||||
return ipalloc_state;
|
return ipalloc_state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user