You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
TheR1sing3un
changed the title
Support fast advance commit index by appeding no-np entry
Support fast advance commit index by appending no-np entry
Jul 16, 2023
TheR1sing3un
changed the title
Support fast advance commit index by appending no-np entry
Support fast advance commit index by appending no-op entry
Jul 16, 2023
…ry (#306)
* feat(core): support fast advance commit index by appending no-np entry
1. support fast advance commit index by appending no-np entry
2. fix some
wrong listen port in ut
* fix(core): fix flaky test for too short wait time
1. fix flaky test for too short wait time
* fix(core): avoid NPE in CommittedEntryIterator
1. avoid NPE in CommittedEntryIterator
* rerun
* rerun
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.
The text was updated successfully, but these errors were encountered: