Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TiDB should retry on every PD client URL until success or failure #35268

Closed
JmPotato opened this issue Jun 9, 2022 · 2 comments · Fixed by #35285
Closed

TiDB should retry on every PD client URL until success or failure #35268

JmPotato opened this issue Jun 9, 2022 · 2 comments · Fixed by #35285
Assignees
Labels
affects-4.0 This bug affects 4.0.x versions. affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. affects-6.0 affects-6.1 severity/minor sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@JmPotato
Copy link
Member

JmPotato commented Jun 9, 2022

Bug Report

1. Minimal reproduce step (Required)

  1. Start a cluster with 3 PD instances.
  2. Kill the PD server that is first in the list of members returned by the pd.GetMemebers and do not reboot it.
  3. Try show config SQL on TiDB.

2. What did you expect to see? (Required)

TiDB executes the SQL successfully.

3. What did you see instead (Required)

origin_img_v2_e1106400-fe1b-44bc-8fa8-9355c7b2bf2g

Root case

GetPDServerInfo should retry on every PD client URL until success or failure. In this case, if the first member is the PD server that crashes, it will never work until the PD server reboots.

tidb/infoschema/tables.go

Lines 1658 to 1669 in 7500d79

for _, addr := range members {
// Get PD version, git_hash
url := fmt.Sprintf("%s://%s%s", util.InternalHTTPSchema(), addr, pdapi.Status)
req, err := http.NewRequest(http.MethodGet, url, nil)
if err != nil {
return nil, errors.Trace(err)
}
req.Header.Add("PD-Allow-follower-handle", "true")
resp, err := util.InternalHTTPClient().Do(req)
if err != nil {
return nil, errors.Trace(err)
}

@JmPotato
Copy link
Member Author

/label affects-6.1, affects-6.0, affects-5.4, affects-5.3, affects-5.2, affects-5.1, affects-5.0, affects-4.0

@jebter
Copy link

jebter commented Jun 16, 2022

/label affects-6.1
/label affects-6.0
/label affects-5.4
/label affects-5.3
/label affects-5.2
/label affects-5.1
/label affects-5.0
/label affects-4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-4.0 This bug affects 4.0.x versions. affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. affects-6.0 affects-6.1 severity/minor sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants