tikv / tikv/pd

Random connect PD instance for the MemberList grpc call

Open
#9,110 0 comments 0 reactions 0 assignees View on GitHub
type/feature-request
Dominant language
Go
Stars
1.2k
Forks
783
Avg merge
5d 21h
Merged PRs (30d)
36

Description

## Feature Request
Random connect PD instance for the MemberList call

### Describe your feature request related problem

When PD looses leadership, all TiKV/TiDB pods start to call MemberList on PD/ETCD to find the leader. During incident we found that all these calls always go to a particular PD instance.
It seems we always sort the PD members, thus when TiKV/TiDB trying to get the PD leaders they always reach to a specific PD pod which caused disproportional GRPC calls increase on the PD instance.

```
func (c *RaftCluster) Members() []*Member {
c.Lock()
defer c.Unlock()
var ms MembersByID
for _, m := range c.members {
ms = append(ms, m.Clone())
}
sort.Sort(ms)
return []*Member(ms)
}
```
### Describe the feature you'd like

### Describe alternatives you've considered

### Teachability, Documentation, Adoption, Migration Strategy

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.