Reduce unavailable time caused by leader election #1658
Labels
status/discussion-wanted
The issue needs to be discussed.
type/enhancement
The issue or PR belongs to an enhancement.
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.The text was updated successfully, but these errors were encountered: