Skip to content

balance, proxy: support evicting backends by config (#1116)#1133

Merged
djshow832 merged 4 commits intopingcap:release-1.3from
djshow832:cherry-pick-1116
Apr 21, 2026
Merged

balance, proxy: support evicting backends by config (#1116)#1133
djshow832 merged 4 commits intopingcap:release-1.3from
djshow832:cherry-pick-1116

Conversation

@djshow832
Copy link
Copy Markdown
Collaborator

This is a manual cherry-pick of #1116

What problem does this PR solve?

Issue Number: close #1115

Problem Summary:
When a backend is confirmed to fail, we need a way to evict it manually.

What is changed and how it works:

  • add proxy.fail-backend-list and proxy.failover-timeout config
  • stop routing new connections to failed backends and migrate existing ones away
  • force close remaining connections after the failover timeout
  • if no more available backends, ignore the list to be HA
  • allow fail-backend-list to match by pod name or backend address

Check List

Tests

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

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.

- Support evict failed backends by config

@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Apr 21, 2026

This cherry pick PR is for a release branch and has not yet been approved by triage owners.
Adding the do-not-merge/cherry-pick-not-approved label.

To merge this cherry pick:

  1. It must be LGTMed and approved by the reviewers firstly.
  2. For pull requests to TiDB-x branches, it must have no failed tests.
  3. AFTER it has lgtm and approved labels, please wait for the cherry-pick merging approval from triage owners.
Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@ti-chi-bot ti-chi-bot Bot added the size/XXL label Apr 21, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 21, 2026

Codecov Report

❌ Patch coverage is 85.41667% with 35 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release-1.3@90ecc64). Learn more about missing BASE report.

Files with missing lines Patch % Lines
pkg/balance/factor/factor_balance.go 0.00% 13 Missing ⚠️
pkg/balance/policy/simple_policy.go 0.00% 7 Missing ⚠️
pkg/balance/router/router.go 86.36% 4 Missing and 2 partials ⚠️
pkg/balance/router/router_score.go 97.10% 2 Missing and 2 partials ⚠️
pkg/proxy/backend/backend_conn_mgr.go 81.25% 2 Missing and 1 partial ⚠️
lib/config/proxy.go 90.90% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff               @@
##             release-1.3    #1133   +/-   ##
==============================================
  Coverage               ?   65.44%           
==============================================
  Files                  ?      123           
  Lines                  ?    11947           
  Branches               ?        0           
==============================================
  Hits                   ?     7819           
  Misses                 ?     3603           
  Partials               ?      525           
Flag Coverage Δ
unit 65.44% <85.41%> (?)

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.

@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Apr 21, 2026

@YangKeao: adding LGTM is restricted to approvers and reviewers in OWNERS files.

Details

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link
Copy Markdown
Collaborator Author

@djshow832 djshow832 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-chi-bot ti-chi-bot Bot added the approved label Apr 21, 2026
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Apr 21, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: YangKeao

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

The pull request process is described 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 lgtm label Apr 21, 2026
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Apr 21, 2026

[LGTM Timeline notifier]

Timeline:

  • 2026-04-21 08:12:29.930553689 +0000 UTC m=+2067155.135913746: ☑️ agreed by YangKeao.

@djshow832 djshow832 merged commit 80f4ef7 into pingcap:release-1.3 Apr 21, 2026
5 of 6 checks passed
@djshow832 djshow832 deleted the cherry-pick-1116 branch April 21, 2026 08:17
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.

3 participants