pingcap / pingcap/tiproxy

Optimize the procedure of querying backend info when many backends are down

Open
#595 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.