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: add tests for router #74

Merged
merged 4 commits into from
Sep 5, 2022
Merged

router: add tests for router #74

merged 4 commits into from
Sep 5, 2022

Conversation

djshow832
Copy link
Collaborator

@djshow832 djshow832 commented Sep 3, 2022

What problem does this PR solve?

Issue Number: close #73

Problem Summary:

  • When the sysbench closes, the rebalancer frequently migrates sessions because the connections are unbalanced again and again after closing too many connections.
  • Lack of tests.

What is changed and how it works:

  • Add a minimal interval to the redirection to avoid migrating too frequently.
  • Add a minimal interval for redirection failure to avoid unnecessary retrials. That is, after a connection fails to redirect (maybe because it contains local temporary tables), it won't be redirected again in 3 seconds.
  • Add the unhealthy empty backend back to the router when a connection fails to redirect and cannot find the original backend. This avoids wild connections.
  • When the balancer searches for a connection to redirect, skip the redirecting connection and search for the next one. This avoids that a connection migrates for too long and blocks other connections from migrating.
  • Add tests for the router.

TODO:

Check List

Tests

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

Scale-in, scale-out, and close clients when 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

@xhebox xhebox merged commit c4d3fa9 into pingcap:main Sep 5, 2022
@djshow832 djshow832 deleted the router_test branch September 5, 2022 07:25
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 Router
2 participants