Skip to content

v0.9.15

Compare
Choose a tag to compare
@drmingdrmer drmingdrmer released this 28 Aug 05:15
· 175 commits to main since this release

Summary:

  • Fixed:
    • 0b1293f3 Should not update vote when seeing higher vote in RequestVote response.
    • 94b1e843 Clarify that receiving an equal vote does not grant leadership.
  • Added:
    • 5f5d7e9f Add TypeConfigExt to simplify RaftTypeConfig Access.

Detail:

Fixed:

  • Fixed: 0b1293f3 Should not update vote when seeing higher vote in RequestVote response; by 张炎泼; 2024-07-04

    This commit addresses an issue in the vote updating mechanism during the
    handling of RequestVote responses. Previously, encountering a higher
    vote in a response incorrectly led to an update of the local
    state.vote, which could break Raft consistency rules.

    Issue Description:

    • A higher vote seen in a RequestVote response does not necessarily
      mean that the vote is granted. The local state.vote should only be
      updated if the vote is actually granted, i.e., the responding node has
      a higher vote and a last_log_id that allows it to become a leader.

    Resolution:

    • The local state.vote will no longer be updated upon merely seeing a
      higher vote in the RequestVote response. Instead, this higher vote
      will be recorded in last_seen_vote for consideration in the next
      election cycle, without updating the current state.vote.

    This bug is introduced in: f0a9e34

  • Fixed: 94b1e843 Clarify that receiving an equal vote does not grant leadership.; by 张炎泼; 2024-08-28

    A node's vote may 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_granted to indicate a vote
    is granted.

    This commit also fix:

Added:

  • Added: 5f5d7e9f Add TypeConfigExt to simplify RaftTypeConfig Access; by 张炎泼; 2024-07-03

    This commit introduces a new trait, TypeConfigExt, which extends
    RaftTypeConfig. The purpose of this trait is to simplify the access to
    various functionalities provided by the RaftTypeConfig trait,
    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 call C::now().