Skip to content

router: add port-based routing groups#1106

Open
YangKeao wants to merge 2 commits intopingcap:mainfrom
YangKeao:pr/05-multi-cluster-router-port
Open

router: add port-based routing groups#1106
YangKeao wants to merge 2 commits intopingcap:mainfrom
YangKeao:pr/05-multi-cluster-router-port

Conversation

@YangKeao
Copy link
Copy Markdown
Member

@YangKeao YangKeao commented Mar 19, 2026

What problem does this PR solve?

Issue Number: close #1100

Add port-based routing to the score-based router.

This PR introduces:

  • routing-rule = "port"
  • routing by the SQL listener port
  • cluster-scoped port groups
  • cross-cluster port-conflict detection and blocking

What is changed and how it works:

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
Copy link
Copy Markdown

ti-chi-bot bot commented Mar 19, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot bot commented Mar 19, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign yangkeao for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

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

Details 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

@ti-chi-bot ti-chi-bot bot added the size/XXL label Mar 19, 2026
@YangKeao YangKeao force-pushed the pr/05-multi-cluster-router-port branch from df7706a to f6dd0c1 Compare March 19, 2026 17:33
@YangKeao YangKeao marked this pull request as ready for review March 19, 2026 17:37
@ti-chi-bot ti-chi-bot bot requested a review from djshow832 March 19, 2026 17:37
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 19, 2026

Codecov Report

❌ Patch coverage is 79.68338% with 77 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@30d5b3f). Learn more about missing BASE report.

Files with missing lines Patch % Lines
pkg/manager/backendcluster/metrics_querier.go 65.51% 27 Missing and 3 partials ⚠️
pkg/manager/backendcluster/cluster.go 64.51% 10 Missing and 1 partial ⚠️
pkg/balance/router/port_conflict_detector.go 67.74% 7 Missing and 3 partials ⚠️
pkg/balance/metricsreader/query_result.go 80.43% 6 Missing and 3 partials ⚠️
pkg/balance/router/router_score.go 94.44% 3 Missing and 1 partial ⚠️
pkg/manager/backendcluster/manager.go 55.55% 4 Missing ⚠️
pkg/balance/metricsreader/metrics_reader.go 82.35% 3 Missing ⚠️
pkg/proxy/backend/backend_conn_mgr.go 0.00% 2 Missing and 1 partial ⚠️
pkg/server/server.go 75.00% 2 Missing ⚠️
pkg/balance/metricsreader/backend_reader.go 96.55% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1106   +/-   ##
=======================================
  Coverage        ?   67.42%           
=======================================
  Files           ?      146           
  Lines           ?    15361           
  Branches        ?        0           
=======================================
  Hits            ?    10357           
  Misses          ?     4305           
  Partials        ?      699           
Flag Coverage Δ
unit 67.42% <79.68%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@YangKeao
Copy link
Copy Markdown
Member Author

/test all

@YangKeao YangKeao force-pushed the pr/05-multi-cluster-router-port branch 2 times, most recently from ac6b145 to 76c923a Compare March 20, 2026 06:20
@YangKeao
Copy link
Copy Markdown
Member Author

/test all

@YangKeao YangKeao force-pushed the pr/05-multi-cluster-router-port branch 7 times, most recently from 64cec42 to ceba1e1 Compare March 24, 2026 13:52
@YangKeao YangKeao force-pushed the pr/05-multi-cluster-router-port branch 2 times, most recently from 623fdb8 to 2b207b7 Compare March 24, 2026 14:21
@YangKeao YangKeao force-pushed the pr/05-multi-cluster-router-port branch 6 times, most recently from 192239f to f7b0611 Compare April 2, 2026 12:43
@YangKeao YangKeao marked this pull request as ready for review April 2, 2026 13:08
@YangKeao YangKeao force-pushed the pr/05-multi-cluster-router-port branch from f7b0611 to b4738f8 Compare April 2, 2026 14:39
@YangKeao YangKeao force-pushed the pr/05-multi-cluster-router-port branch from b4738f8 to 27d411e Compare April 2, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add port-based routing rules and groups.

2 participants