Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

Optimisation: Candidate can possibly retry on request vote if request delivered on lower currentTerm #61

Open
ktoso opened this issue Aug 8, 2015 · 1 comment

Comments

@ktoso
Copy link
Owner

ktoso commented Aug 8, 2015

This:

        case Event(msg: RequestVote, m: ElectionMeta) if msg.term > m.currentTerm =>
            log.info("Received newer {}. Current term is {}. Revert to follower state.", msg.term, m.currentTerm)

as @colin-scott mentioned, perhaps could be improved to try again after becoming:

perhaps you should forward the RequestVote message instead of dropping it?

e.g.

m.clusterSelf forward msg
goto(Follower) using m.forFollower(msg.term)
@colin-scott
Copy link
Contributor

This optimization can be applied in a bunch of places. Basically, whenever any nodes receives a message that has a higher term, it should forward that message to itself before transitioning to a new term.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants