Fix election timeout to reduce conflicts
Improved:
-
Improved: 23f4a73b AppDataResponse does not need a Clone trait bound; by 张炎泼; 2023-03-09
- Fix: #703
-
Improved: 664635e0 loosen validity check with RaftState.snapshot_last_log_id(); by 张炎泼; 2023-03-10
A application may not persist snapshot. And when it restarted, the
last-purged-log-id is notNone
butsnapshot_last_log_id()
is None.
This is a valid state and should not emit error. -
Improved: 54aea8a2 fix: delay election if a greater last log id is seen; by 张炎泼; 2023-03-14
If this node sees a greater last-log-id on another node, it will be less
likely to be elected as a leader.
In this case, it is necessary to sleep for a longer period of time
smaller_log_timeout
so that other nodes with a greater last-log-id
have a chance to elect themselves.
Changed:
-
Changed: 9ddb5715 RaftState: make
RaftState.vote
private. Accesses vote via 2 new public methods:vote_ref()
andvote_last_modified()
.; by 张炎泼; 2023-03-12 -
Changed: 3b4f4e18 move log id related traits to mod
openraft::log_id
; by 张炎泼; 2023-03-14Move trait
RaftLogId
,LogIdOptionExt
andLogIndexOptionExt
fromopenraft::raft_types
to modopenraft::log_id