cockroachdb / cockroachdb/cockroach

kv/raft: force campaigning on leader removal should respect fortification

Open
#129,796 1 comment 0 reactions 1 assignee Assigned to @iskettaneh View on GitHub
A-kv-replication A-leader-leases C-enhancement T-kv
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.