Enhance /ready and /readyz to better indicate the service readiness
- Dominant language
- Go
- Stars
- 1.2k
- Forks
- 783
- Avg merge
- 5d 21h
- Merged PRs (30d)
- 36
Description
## Enhancement Task
`/ready` and `/readyz` are API endpoints used to show the service readiness, especially the readiness whether the PD leader can be transfered to the current node. However, at present, they still have some shortcomings in indicating the serviceable status of region metadata. Specifically, since the current check only verifies whether the process of loading regions from the disk has been completed, it may result in a situation where the interface already shows “ready,” but the region metadata on it is still insufficient to fully support external access requirements.
https://github.com/tikv/pd/blob/bae53730c0650d5ba1c701e4d0ef2acfa755f9de/server/apiv2/handlers/ready.go#L156-L176
A more complete approach might be to check whether the metadata state of the current node differs from that of the leader—the smaller the gap, the better it reflects the node’s readiness to provide seamless service like the leader.
Contributor guide
Assessment
This issue has not been assessed yet.