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: remove connMap #238

Merged
merged 3 commits into from
Mar 7, 2023
Merged

router: remove connMap #238

merged 3 commits into from
Mar 7, 2023

Conversation

xhebox
Copy link
Collaborator

@xhebox xhebox commented Mar 6, 2023

What problem does this PR solve?

Issue Number: close None

Problem Summary: Instead of keep a map of id <-> conn, we could store additional router data, e.g. pointer to the list element, into conn directly.

What is changed and how it works:

  1. Split NewScoreBasedRouter into two functions, another one is Init. It is to cleanup initialization in router_test.go. Gateway may need to adapt it.
  2. Add SetValue and Value. It is used to store Elemet[*connWrapper]. We can locate the list element instantly.

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 (Don't forget to add the declarative for API)
  • Has tiproxyctl change
  • Other user behavior changes

Release note

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

None

@xhebox xhebox requested a review from djshow832 March 6, 2023 08:12
@xhebox xhebox force-pushed the connMap branch 2 times, most recently from de7eca3 to bc061cd Compare March 6, 2023 08:29
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
@djshow832 djshow832 merged commit 8a67487 into pingcap:main Mar 7, 2023
xhebox added a commit to xhebox/TiProxy that referenced this pull request Mar 13, 2023
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.

2 participants