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

router, backend: show server version from TiDB #281

Merged
merged 3 commits into from
May 18, 2023

Conversation

djshow832
Copy link
Collaborator

@djshow832 djshow832 commented May 16, 2023

What problem does this PR solve?

Issue Number: close #272, #217

Problem Summary:

  • When a client connects to the dedicated tier, the server version is always 5.7.25-TiDB-None
  • We can't see why TiProxy thinks a TiDB is down when troubleshooting

What is changed and how it works:

  • Replace BackendStatus with backendHealth to store serverVersion and pingErr
  • Read the server version from the backend during health checks
  • Send the server version of any backend to the client when handshake. It may be wrong when there are multiple versions running
  • Log the error why TiProxy can't connect to TiDB when TiDB is removed from the router

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code
  1. Start a TiDB cluster with v7.0.0
  2. Start a MySQL client to connect to it and the client shows Server version: 5.7.25-TiDB-v7.0.0 TiDB Server (Apache License 2.0) Community Edition, MySQL 5.7 compatible
  3. Scale in one TiDB and TiProxy logs [update backend] [namespace=default] [backend_addr=127.0.0.1:4000] [prev="status: healthy"] [cur="status: down, err: http status 500: connect status port failed"]

Notable changes

  • Has configuration change
  • Has HTTP API interfaces change
  • Has tiproxyctl change
  • Other user behavior changes

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@djshow832 djshow832 requested a review from xhebox May 16, 2023 11:39
@xhebox xhebox merged commit 04120b6 into pingcap:main May 18, 2023
@djshow832 djshow832 deleted the server_version branch May 18, 2023 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Server version is always xxx-None
2 participants