Skip to content
New issue

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

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

Already on GitHub? # to your account

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

Closed
TheR1sing3un opened this issue Jul 16, 2023 · 0 comments · Fixed by #306
Closed

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

TheR1sing3un opened this issue Jul 16, 2023 · 0 comments · Fixed by #306

Comments

@TheR1sing3un
Copy link
Contributor

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.

@TheR1sing3un 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 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
RongtongJin pushed a commit that referenced this issue Jul 17, 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
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant