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: fix connection score becomes wrong when a connection closes during redirecting #451

Merged
merged 2 commits into from
Jan 16, 2024

Conversation

djshow832
Copy link
Collaborator

What problem does this PR solve?

Issue Number: close #448

Problem Summary:
There were 2 ways to update the connection score correctly when a connection closes after receiving a redirection signal:

  • The connection passes the target backend to the router when it closes
  • The router requests for the target backend when the connection closes

However, both these 2 ways are removed, and the connection score is incorrectly maintained.

What is changed and how it works:
Maintain the target backend in the router itself. When a connection is closed during redirecting, get the target backend from the router itself.

Check List

Tests

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

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

@ti-chi-bot ti-chi-bot bot requested review from bb7133 and xhebox January 15, 2024 02:39
@ti-chi-bot ti-chi-bot bot added the size/M label Jan 15, 2024
@ti-chi-bot ti-chi-bot bot added the lgtm label Jan 16, 2024
Copy link

ti-chi-bot bot commented Jan 16, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: xhebox

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

ti-chi-bot bot commented Jan 16, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-01-16 05:32:06.842628199 +0000 UTC m=+247568.406925904: ☑️ agreed by xhebox.

@ti-chi-bot ti-chi-bot bot added the approved label Jan 16, 2024
@ti-chi-bot ti-chi-bot bot merged commit 475507c into pingcap:main Jan 16, 2024
5 checks passed
@djshow832 djshow832 deleted the conn_score branch January 16, 2024 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TiDB is unbalanced after redirection is interrupted
2 participants