feat(raft-library): task 3.3 — raft_on_vote_request 6-step decision; 10 tests
This commit is contained in:
parent
4955fa3805
commit
e0bcb35554
3 changed files with 497 additions and 15 deletions
|
|
@ -40,7 +40,7 @@
|
|||
- Fires `on_trace` events: `election_start`, `self_vote`, `term_update` if NULL-safe checks pass
|
||||
- _Requirements: 2.1, 2.2, 2.3, 6.1_
|
||||
|
||||
- [ ] 3.3 Implement raft_on_vote_request (incoming RequestVote processing)
|
||||
- [x] 3.3 Implement raft_on_vote_request (incoming RequestVote processing)
|
||||
- Stale term: `term < current_term` → set `*reply_term`, fire `on_trace(vote_denied_stale_term)`, return `RAFT_DENY`
|
||||
- Term upgrade: `term > current_term` → update `current_term=term`, clear `voted_for=-1`, set `role=RAFT_FOLLOWER`, fire `on_trace(term_update)`
|
||||
- Role gate: if `role == RAFT_LEADER` → return `RAFT_DENY` (fire `on_trace(vote_denied_role)`); note: COMMITTING state is delegated to `on_vote_eligible` in the adapter
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue