cockroachdb / cockroachdb/cockroach

raft: make progress map used only in StateLeader

Open
#143,852 0 comments 0 reactions 0 assignees View on GitHub
A-kv-replication branch-master C-cleanup
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

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.