cockroachdb / cockroachdb/cockroach
kvserver: replica load is reset twice on lease application when changing hands
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
`ReplicaLoad` is [reset](https://github.com/cockroachdb/cockroach/blob/a227d7867b16e38ecd1b0b61bb2688ac566eb6ee/pkg/kv/kvserver/load/replica_load.go#L168-L169) twice on lease application when the lease changes hands on the current leaseholder:
https://github.com/cockroachdb/cockroach/blob/a227d7867b16e38ecd1b0b61bb2688ac566eb6ee/pkg/kv/kvserver/replica_proposal.go#L434-L434
https://github.com/cockroachdb/cockroach/blob/a227d7867b16e38ecd1b0b61bb2688ac566eb6ee/pkg/kv/kvserver/replica_proposal.go#L505-L505
Note it is reset only once on the prior leaseholder. The stats **should be reset exactly once**, although there's no major impact of resetting these twice (other than confusion and a small cost).
Jira issue: CRDB-32100
Contributor guide
Assessment
This issue has not been assessed yet.