fix(election): no-config nodes set CTRL_STANDBY to trigger config fetch; voter-only path
This commit is contained in:
parent
a75fb2581b
commit
04b31afb06
1 changed files with 3 additions and 0 deletions
|
|
@ -2410,6 +2410,9 @@ void ha_start_election_async(ha_state_t *ha, cluster_t *c,
|
|||
if (my_config_tag == 0 && n_peers > 1) {
|
||||
INFO("ha_start_election_async: no local config (tag=0, n_peers=%d) — "
|
||||
"participating as voter only, not starting own election", n_peers);
|
||||
/* Transition to CTRL_STANDBY so myapp_run schedules fetch_config_from_primary.
|
||||
* The primary will push config via ctrlhello once it enters COMMITTING. */
|
||||
atomic_store_explicit(&ha->role, (int32_t)CTRL_STANDBY, memory_order_release);
|
||||
/* Free ctx — no vote sends will happen from this node this round. */
|
||||
atomic_store_explicit(&ha->elect_ctx, NULL, memory_order_release);
|
||||
pthread_mutex_destroy(&ctx->lock);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue