Skip to content

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

Merged
ti-chi-bot[bot] merged 10 commits intopingcap:release-nextgen-202603from
ti-chi-bot:cherry-pick-1116-to-release-nextgen-202603
Apr 20, 2026
Merged

balance, proxy: support evicting backends by config (#1116)#1131
ti-chi-bot[bot] merged 10 commits intopingcap:release-nextgen-202603from
ti-chi-bot:cherry-pick-1116-to-release-nextgen-202603

Conversation

@ti-chi-bot
Copy link
Copy Markdown
Member

This is an automated 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 ti-chi-bot Bot added the lgtm label Apr 20, 2026
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Apr 20, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: djshow832

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

ti-chi-bot Bot commented Apr 20, 2026

[LGTM Timeline notifier]

Timeline:

  • 2026-04-20 06:59:45.796992034 +0000 UTC m=+1976391.002352081: ☑️ agreed by djshow832.

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

/retest

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.02620% with 32 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release-nextgen-202603@349d1f7). 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/group.go 96.61% 2 Missing and 2 partials ⚠️
pkg/balance/router/router.go 92.85% 2 Missing and 1 partial ⚠️
pkg/proxy/backend/backend_conn_mgr.go 81.25% 2 Missing and 1 partial ⚠️
lib/config/proxy.go 88.23% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@                    Coverage Diff                    @@
##             release-nextgen-202603    #1131   +/-   ##
=========================================================
  Coverage                          ?   67.25%           
=========================================================
  Files                             ?      149           
  Lines                             ?    15983           
  Branches                          ?        0           
=========================================================
  Hits                              ?    10749           
  Misses                            ?     4504           
  Partials                          ?      730           
Flag Coverage Δ
unit 67.25% <86.02%> (?)

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 ti-chi-bot Bot merged commit d34a518 into pingcap:release-nextgen-202603 Apr 20, 2026
6 checks passed
@djshow832 djshow832 deleted the cherry-pick-1116-to-release-nextgen-202603 branch April 20, 2026 07:19
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