v0.9.15
Summary:
- Fixed:
- Added:
- 5f5d7e9f Add
TypeConfigExtto simplifyRaftTypeConfigAccess.
- 5f5d7e9f Add
Detail:
Fixed:
-
Fixed: 0b1293f3 Should not update
votewhen seeing higher vote inRequestVoteresponse; by 张炎泼; 2024-07-04This commit addresses an issue in the vote updating mechanism during the
handling ofRequestVoteresponses. Previously, encountering a higher
votein a response incorrectly led to an update of the local
state.vote, which could break Raft consistency rules.Issue Description:
- A higher
voteseen in aRequestVoteresponse does not necessarily
mean that the vote is granted. The localstate.voteshould only be
updated if the vote is actually granted, i.e., the responding node has
a highervoteand alast_log_idthat allows it to become a leader.
Resolution:
- The local
state.votewill no longer be updated upon merely seeing a
highervotein theRequestVoteresponse. Instead, this higher vote
will be recorded inlast_seen_votefor consideration in the next
election cycle, without updating the currentstate.vote.
This bug is introduced in: f0a9e34
- A higher
-
Fixed: 94b1e843 Clarify that receiving an equal vote does not grant leadership.; by 张炎泼; 2024-08-28
A node's
votemay be updated when a leader observes a higher vote.
In such cases, the leader updates its local vote and steps down.
However, this vote update does not imply that the node accepts the
higher vote as valid for leadership, as it has not yet compared their
logs.In this commit, re-enable
VoteResponse.vote_grantedto indicate a vote
is granted.This commit also fix:
- Fix: #1236
Added:
-
Added: 5f5d7e9f Add
TypeConfigExtto simplifyRaftTypeConfigAccess; by 张炎泼; 2024-07-03This commit introduces a new trait,
TypeConfigExt, which extends
RaftTypeConfig. The purpose of this trait is to simplify the access to
various functionalities provided by theRaftTypeConfigtrait,
enhancing code readability and reducing complexity.Methods Added to
TypeConfigExt:now()sleep()sleep_until()timeout()timeout_at()oneshot()spawn()
Usage Improvement:
- Instead of using the
<<C as RaftTypeConfig>::AsyncRuntime as AsyncRuntime>::Instant::now(),
you can now simply callC::now().