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

RAFT: Follower's term is not incremented for request_vote RPC #20

Closed
jaseemabid opened this issue Dec 15, 2015 · 4 comments
Closed

RAFT: Follower's term is not incremented for request_vote RPC #20

jaseemabid opened this issue Dec 15, 2015 · 4 comments

Comments

@jaseemabid
Copy link

Follower's term is only incremented after it receives a heartbeat.

Here is the relevant section from the spec.

\* Server i receives a RequestVote request from server j with
\* m.mterm <= currentTerm[i].
HandleRequestVoteRequest(i, j, m) ==
    LET logOk == \/ m.mlastLogTerm > LastTerm(log[i])
                 \/ /\ m.mlastLogTerm = LastTerm(log[i])
                    /\ m.mlastLogIndex >= Len(log[i])
        grant == /\ m.mterm = currentTerm[i]
                 /\ logOk
                 /\ votedFor[i] \in {Nil, j}
    IN /\ m.mterm <= currentTerm[i]
       /\ \/ grant  /\ votedFor' = [votedFor EXCEPT ![i] = j]
          \/ ~grant /\ UNCHANGED votedFor
       /\ Reply([mtype        |-> RequestVoteResponse,
                 mterm        |-> currentTerm[i],
                 mvoteGranted |-> grant,
                 \* mlog is used just for the `elections' history variable for
                 \* the proof. It would not exist in a real implementation.
                 mlog         |-> log[i],
                 msource      |-> i,
                 mdest        |-> j],
                 m)
       /\ UNCHANGED <<state, currentTerm, candidateVars, leaderVars, logVars>>

The reply contains original term of the follower.

@jaseemabid
Copy link
Author

@jaseemabid
Copy link
Author

@ongardie 's comment here #1 (comment) suggest otherwise.

Can you please verify?

@jaseemabid
Copy link
Author

This is slightly confusing, so I asked in the mailing list for clarification. https://groups.google.com/forum/#!topic/raft-dev/Dn6eNSCAjeQ

@jaseemabid
Copy link
Author

My bad, the behavior is correct. @swvist clarified in the mailing list. Closing this bug.

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

No branches or pull requests

1 participant