mirror of
https://git.proxmox.com/git/mirror_corosync
synced 2026-02-01 16:02:31 +00:00
votequorum: make atb consistent on nodelist reload
When the cluster changes from even sized to odd sized corosync disables auto-tie-breaker if wait_for_all is not enabled. However when changing from odd sized to even sized it doesn't reenable it, causing auto_tie_breaker to be inconsistent across the cluster: the newly added node and any nodes that restart corosync will have it, but all the previously running nodes won't. Signed-off-by: Edwin Torok <edvin.torok@citrix.com> Reviewed-by: Jan Friesse <jfriesse@redhat.com>
This commit is contained in:
parent
76591baa4a
commit
15383b3eb3
@ -81,7 +81,7 @@ static uint8_t two_node = 0;
|
||||
static uint8_t wait_for_all = 0;
|
||||
static uint8_t wait_for_all_status = 0;
|
||||
|
||||
static enum {ATB_NONE, ATB_LOWEST, ATB_HIGHEST, ATB_LIST} auto_tie_breaker = ATB_NONE;
|
||||
static enum {ATB_NONE, ATB_LOWEST, ATB_HIGHEST, ATB_LIST} auto_tie_breaker = ATB_NONE, initial_auto_tie_breaker = ATB_NONE;
|
||||
static int lowest_node_id = -1;
|
||||
static int highest_node_id = -1;
|
||||
|
||||
@ -1253,6 +1253,13 @@ static char *votequorum_readconfig(int runtime)
|
||||
if (runtime) {
|
||||
two_node = 0;
|
||||
expected_votes = 0;
|
||||
/* auto_tie_breaker cannot be changed by config reload, but
|
||||
* we automatically disable it on odd-sized clusters without
|
||||
* wait_for_all.
|
||||
* We may need to re-enable it when membership changes to ensure
|
||||
* that auto_tie_breaker is consistent across all nodes */
|
||||
auto_tie_breaker = initial_auto_tie_breaker;
|
||||
icmap_set_uint32("runtime.votequorum.atb_type", auto_tie_breaker);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1331,6 +1338,7 @@ static char *votequorum_readconfig(int runtime)
|
||||
parse_atb_string(atb_string);
|
||||
}
|
||||
free(atb_string);
|
||||
initial_auto_tie_breaker = auto_tie_breaker;
|
||||
|
||||
/* allow_downscale requires ev_tracking */
|
||||
if (allow_downscale) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user