cockroachdb / cockroachdb/cockroach
raft: make progress map used only in StateLeader
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
The `Progress` [map](https://github.com/cockroachdb/cockroach/blob/d07434730a4c5b680138c40588b2e7e1fc14671f/pkg/raft/raft.go#L328) / tracker is conceptually only used by the leader for tracking the replication state. But we [reset](https://github.com/cockroachdb/cockroach/blob/d07434730a4c5b680138c40588b2e7e1fc14671f/pkg/raft/raft.go#L1070-L1081) it in all other states and [maintain](https://github.com/cockroachdb/cockroach/blob/d07434730a4c5b680138c40588b2e7e1fc14671f/pkg/raft/raft.go#L2717) when applying config changes.
It should be possible to clean up the code in such a way that the tracker is only set/used in `StateLeader`.
Jira issue: CRDB-49087
Contributor guide
Assessment
This issue has not been assessed yet.