Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
131716: raft: use candidate's log term to determine inFortifyLease condition r=nvanbenschoten a=arulajmani Previously, if a node received a Msg{,Pre}Vote request from a peer but it still supported a leader in StoreLiveness, the node would reject the request with the justification that it was fortified. However, if the campaigning peer is doing so with a higher log term than we're aware of, then this conclusively proves that the leadership term we're fortifying has actually ended. This then allows us to de-fortify, which ends our fortification lease, granting us the freedom to call elections and vote in the current (and future) campaigns. This patch recognizes this case and switches to this behavior. Note that this is more than just an optimization -- one can craft scenarios where de-fortifying and voting in an election is the only way we'll ever elect a new leader. One such scenario is shown in the test case attached to this commit. Epic: none Release note: None Co-authored-by: Arul Ajmani <[email protected]>
- Loading branch information