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

Enhance RequestVote receiving #126

Merged
merged 16 commits into from
Feb 10, 2022
Merged

Enhance RequestVote receiving #126

merged 16 commits into from
Feb 10, 2022

Conversation

xirc
Copy link
Contributor

@xirc xirc commented Feb 7, 2022

Closes #125

  • Use new method ReplicatedLog.isGivenLogUpToDate that determines the given log is at least as up-to-date as this log
  • Leader accept RequestVote(lastLogIndex < log.lastLogIndex, lastLogTerm > log.lastLogTerm)
  • Candidate accept RequestVote(lastLogIndex < log.lastLogIndex, lastLogTerm > log.lastLogTerm)
  • Follower accept RequestVote(lastLogIndex < log.lastLogIndex, lastLogTerm > log.lastLogTerm)
  • Add tests of receiving RequestVote
    • Also verify RaftActor's state after process the RequestVote

@xirc xirc force-pushed the enhance-request-vote branch 2 times, most recently from cebc5e4 to 58507e9 Compare February 7, 2022 09:08
Taichi Yamakawa added 15 commits February 8, 2022 10:59
* Focus on the test topic
* Provide a consistent framework to test:
  * Reply message
  * State after the reply
* Focus on the test topic
* Provide a consistent framework to test:
  * Reply message
  * State after the reply
* Focus on the test topic
* Provide a consistent framework to test:
  * Reply message
  * State after the reply
@xirc xirc force-pushed the enhance-request-vote branch from 58507e9 to 7ac0faf Compare February 8, 2022 06:27
@xirc xirc changed the title Enhance RequestVote handling Enhance RequestVote receiving Feb 8, 2022
@xirc xirc marked this pull request as ready for review February 8, 2022 08:00
@xirc xirc requested a review from negokaz February 8, 2022 08:01
Copy link
Contributor

@negokaz negokaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! LGTM 👍

@negokaz negokaz merged commit bd440c9 into master Feb 10, 2022
@negokaz negokaz deleted the enhance-request-vote branch February 10, 2022 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RaftActor doesn't accept RequestVote(lastLogIndex < log.lastLogIndex, lastLogTerm > log.lastLogTerm, ...)
2 participants