feat(ha-single-leader-role): remove CTRL_PRIMARY_COMMITTING enum + remaining decls — compiler-enforced (task 5.2)

This commit is contained in:
Rongsong Shen 2026-06-13 14:41:42 +00:00
parent 7f974e766b
commit 93dfc02717
10 changed files with 44 additions and 55 deletions

View file

@ -120,8 +120,8 @@ int raft_on_vote_request(raft_state_t *s, int from_idx, uint64_t term,
/* Step 2: term upgrade — update term, clear vote, step down to FOLLOWER.
* If we were LEADER, notify the HA FSM so it updates ha->role.
* Without this, the HA FSM stays in CTRL_PRIMARY_COMMITTING and
* eventually promotes to PRIMARY via the committing timeout → split-brain. */
* Without this, the HA FSM stays in CTRL_PRIMARY after losing the term,
* never stepping down to STANDBY → split-brain. */
if (term > s->term) {
int was_leader = (s->role == RAFT_LEADER);
s->term = term;