cockroachdb / cockroachdb/cockroach
raft: remove legacy ConfChange
- 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
Assessment
This issue has not been assessed yet.