Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

raft,tracker: track follower commit index #132

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Commits on Mar 6, 2024

  1. tracker: canonicalize Next in StateSnapshot

    When we send a snapshot, this is equivalent to sending all entries up to
    the snapshot's index. Correspondingly, we update the Next index to
    reflect this in-flight state.
    
    Signed-off-by: Pavel Kalinnikov <[email protected]>
    pav-kv committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    cf5cadf View commit details
    Browse the repository at this point in the history
  2. tracker: track in-flight commit index

    This commit adds a Progress.pendingCommit field tracking the highest
    commit index <= Next-1 which the leader sent to the follower. It is used
    to distinguish cases when a commit index update needs or doesn't need to
    be sent to a follower.
    
    Signed-off-by: Pavel Kalinnikov <[email protected]>
    pav-kv committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    4399f8f View commit details
    Browse the repository at this point in the history
  3. tracker: use a simpler SentEntires method name

    Signed-off-by: Pavel Kalinnikov <[email protected]>
    pav-kv committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    8b05a9d View commit details
    Browse the repository at this point in the history
  4. raft,tracker: track commit index of each follower

    This commit closes a gap in commit index tracking.
    
    Previously, the leader did not precisely know what commit index the
    follower is at, and always had to send an empty MsgApp to brind it up to
    date if it's not.
    
    With this commit, followers now send the commit index of their logs back
    to the leader, and the leader tracks each follower's commit index. This
    will allow the leader (see other commits) to send an empty MsgApp with a
    commit index update only if the tracked index is behind, which will
    reduce the number of unnecessary messages in the system.
    
    Signed-off-by: Pavel Kalinnikov <[email protected]>
    pav-kv committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    c916c15 View commit details
    Browse the repository at this point in the history
  5. tracker: add commit index to debug output

    Signed-off-by: Pavel Kalinnikov <[email protected]>
    pav-kv committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    e246b8d View commit details
    Browse the repository at this point in the history