Optimize the procedure of querying backend info when many backends are down
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 73
- Forks
- 41
- Avg merge
- 21h 3m
- Merged PRs (30d)
- 21
Description
Development Task
Currently, TiProxy queries backend info by querying both TiDBTopologyInfo and TTL from ETCD every few seconds. It's fine when there are few useless backends.
However, in an auto-scaling workload, there are more and more useless backends, who has TiDBTopologyInfo on ETCD but not TTL. It may make querying ETCD very slow or even fail.
So I propose to query all TTL first and query the info by the exact path.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the TiDBTopologyInfo and TTL queries in the backend information code, then trace how ETCD paths are selected. Change the query order so TTL is collected first and topology info is requested only for matching paths. Confirm that workloads with many backends lacking TTL no longer make the ETCD query slow or fail.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100