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

Support checking assertion of Leadership #626

Closed
wants to merge 1 commit into from

Commits on Oct 17, 2024

  1. Support checking assertion of Leadership

    This allows clients of this library to check if the current node, assuming it is the Leader, has explicitly asserted leadership in the current term. "Asserting" is defined has having committed at least one log entry in the current term, as per the Raft paper.
    
    This change adds a new channel, which is only serviced when in Leadership mode. This channel will respond with the asserted status via a Future. Clients are recommended to call this function only until they have confirmed that the leadership has been asserted. Once asserted for a given term the state can be cached until the end of the term.
    
    This code is necessary to properly implement the Read Optimization outlined in the Raft paper and dissertation. The dissertation explains that it is not sufficient to simply check the Leader's commit index. Instead a client must first confirm that the Leader has explicitly asserted leadership by committing a log entry in the current term. Only then is commit index valid.
    otoolep committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    29e5bb4 View commit details
    Browse the repository at this point in the history