cockroachdb / cockroachdb/cockroach

raft: remove legacy ConfChange

Open
#120,616 1 comment 1 reaction 0 assignees View on GitHub
A-kv-replication C-cleanup
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

There are two config change protocols in `raft`: [ConfChange](https://github.com/cockroachdb/cockroach/blob/0b6de9c809f8a4df2ba943a8c9dd023adb03b01d/pkg/raft/raftpb/raft.proto#L161-L170) and [ConfChangeV2](https://github.com/cockroachdb/cockroach/blob/0b6de9c809f8a4df2ba943a8c9dd023adb03b01d/pkg/raft/raftpb/raft.proto#L179-L215). The first is considered legacy, and exists only for backward compatibility. It can be removed.

See https://github.com/cockroachdb/cockroach/blob/0b6de9c809f8a4df2ba943a8c9dd023adb03b01d/pkg/roachpb/data.go#L1534-L1539

A migration would need to have a few stages:

1. Stop writing the legacy `ConfChange`. Should be as easy as `return true` in the code snippet above, behind a version gate.
2. Make sure all `ConfChange` entries in logs are either processed and removed, or migrated to `ConfChangeV2`.
3. Remove the code handling the legacy `ConfigChange`, after another version gate.

Jira issue: CRDB-36778

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.