Reduce unavailable time caused by leader election
Open
status/discussion-wanted
type/enhancement
- Dominant language
- Go
- Stars
- 1.2k
- Forks
- 783
- Avg merge
- 5d 21h
- Merged PRs (30d)
- 36
Description
Currently, when a PD becomes leader, it needs to load all regions meta from storage. During the process, it cannot provide service such as TSO. There are some possible optimizations for this problem.
- Start service before loading regions.
Clients have region cache, sometimes they don't really need `GetRegion` to work. So start the TSO service earlier can help recover some transactions.
- Maintain region tree in follower's memory too.
Now with the `region-storage` feature, followers constantly sync regions with the leader. We can maintain the region tree in all followers, then it won't have to load from storage when becomes leader.
Contributor guide
Assessment
This issue has not been assessed yet.