cockroachdb / cockroachdb/cockroach
kv/raft: force campaigning on leader removal should respect fortification
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
Extracted from https://github.com/cockroachdb/cockroach/issues/125254.
The remaining use of manual campaigning is in `forceCampaignLocked`. However, this use is special in that it uses a "forced" campaign through `MsgTimeoutNow`. It does so because it's trying to handle the case where the raft leader has stepped down or been removed from a range.
In practice, this may be ok today because we will only call `forceCampaignLocked` as the leaseholder-not-leader. Still, if a leader is fortified, we probably want to handle it a different way. Since we only demote leaders to voters and never remove them immediately, there may be a better way to handle this inside of raft, around this logic:
https://github.com/cockroachdb/cockroach/blob/e243814aa348639f6db42d3cbd0dc189ae6f2e29/pkg/raft/raft.go#L2176-L2191
Jira issue: CRDB-41715
Contributor guide
Assessment
This issue has not been assessed yet.