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: refine BackendObserver and add tests #59

Merged
merged 6 commits into from
Aug 31, 2022

Conversation

djshow832
Copy link
Collaborator

@djshow832 djshow832 commented Aug 26, 2022

What problem does this PR solve?

Issue Number: close #58

Problem Summary:

  • The status port cannot stand for the real status of the SQL server.
  • Lack of tests

What is changed and how it works:

  • Also fetch /topology/tidb/ip:port/ttl to filter tombstone backends
  • Dial both the status port and the MySQL protocol port to check the health
  • Add tests

I also proposed 2 enhancements for TiDB graceful shutdown: pingcap/tidb#37471

TODO:

  • Expose some configurations, such as health check interval, just like HAProxy Add more configurations for router #60
  • Split BackendStatus to a separate file
  • Add TLS options to the HTTP status and etcd client connections

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Scale out and scale in the TiDB cluster during running sysbench.

Notable changes

  • Has configuration change
  • Has HTTP API interfaces change (Don't forget to add the declarative for API)
  • Has weirctl 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 August 26, 2022 05:17
@djshow832 djshow832 marked this pull request as draft August 29, 2022 02:00
pkg/manager/router/backend_observer.go Outdated Show resolved Hide resolved
pkg/manager/router/backend_observer.go Outdated Show resolved Hide resolved
pkg/manager/router/backend_observer.go Outdated Show resolved Hide resolved
pkg/manager/router/backend_observer.go Outdated Show resolved Hide resolved
pkg/manager/router/backend_observer_test.go Outdated Show resolved Hide resolved
@djshow832 djshow832 marked this pull request as ready for review August 30, 2022 08:31
@xhebox xhebox merged commit 77b931f into pingcap:main Aug 31, 2022
@djshow832 djshow832 deleted the backend_observer branch August 31, 2022 09:03
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.

Add tests for BackendObserver
2 participants