release-24.3: raft: ensure leaderMaxSupported does not regress when bumping terms #134270
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport 1/1 commits from #133873 on behalf of @arulajmani.
/cc @cockroachdb/release
Previously, it was possible for a leader to regress leaderMaxSupported by calling an election at a higher term. This was because we weren't careful to recognize this case on the leader, and followers had special case handling that allowed a leader to override
inFortifyLease
. Together, this could cause lease regressions for LeaderLeases in some rare cases.This patch fixes this issue by removing special case handling in
inFortifyLease
. We also remove a special case in the handling ofMsgHup
which allowed a leader to step down and campaign without de-fortifying itself.Fixes #133764
Release note: None
Release justification: Fixes a GA blocker.