Skip to content

Support fast advance commit index by appending no-op entry #305

@TheR1sing3un

Description

@TheR1sing3un

According to raft paper, leader can only commit the entries which are belong to current term. So in a sceniaro: leader n0 has appended entry-1 to n1 and n2, but before n0 commit the index-1, it has crashed. Now n1 became leader, but it can't commit the index-1 although more than half peers have stored the entry-1, and the index-1 will never be commited util a new entry is sent to leader for appending.
So we can let new leader append a no-op entry as soon as it becomes leader.When this no-op entry is replicated to more than half peers, leader will advance the commit index to this no-op entry's index.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions