cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
30.21k stars 3.82k forks source link

raft: remove legacy ConfChange #120616

Open pav-kv opened 8 months ago

pav-kv commented 8 months ago

There are two config change protocols in raft: ConfChange and ConfChangeV2. 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

blathers-crl[bot] commented 8 months ago

cc @cockroachdb/replication