Skip to content

Conversation

@ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #832

What problem does this PR solve?

Issue Number: close #828

Problem Summary:

  • When TiDB executes heavy DML, there may be many regionMiss, which causes TiProxy to incorrectly take TiDB as unhealthy.
  • When connections are migrated to one TiDB, the QPS is higher and has more backoff. Judging by the backoff number is unfair.
  • There may be panic when TiDB locations are the same.
  • If the router panics, the panic reason is not logged.

What is changed and how it works:

  • Remove regionMiss backoffs in the health judgment
  • Change backoff number to backoff rate in the health judgment
  • Fix possible panic
  • Recover router panic and log the panic stack

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.

- Fix TiDB regionMiss backoff causes TiProxy to incorrectly migrate connections

@ti-chi-bot
Copy link

ti-chi-bot bot commented Jul 22, 2025

[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 ti-chi-bot bot added the lgtm label Jul 22, 2025
@ti-chi-bot
Copy link

ti-chi-bot bot commented Jul 22, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-07-22 00:38:44.164883244 +0000 UTC m=+38680.902309458: ☑️ agreed by djshow832.

@ti-chi-bot ti-chi-bot bot added the approved label Jul 22, 2025
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 85.71429% with 18 lines in your changes missing coverage. Please review.

Please upload report for BASE (release-1.3@efb4014). Learn more about missing BASE report.

Files with missing lines Patch % Lines
pkg/balance/factor/factor_cpu.go 0.00% 4 Missing and 2 partials ⚠️
pkg/balance/factor/factor_health.go 94.39% 4 Missing and 2 partials ⚠️
pkg/balance/factor/factor_memory.go 0.00% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@              Coverage Diff               @@
##             release-1.3     #834   +/-   ##
==============================================
  Coverage               ?   66.67%           
==============================================
  Files                  ?      123           
  Lines                  ?    11557           
  Branches               ?        0           
==============================================
  Hits                   ?     7706           
  Misses                 ?     3304           
  Partials               ?      547           
Flag Coverage Δ
unit 66.67% <85.71%> (?)

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 8e2a106 into pingcap:release-1.3 Jul 22, 2025
6 checks passed
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