Skip to content

*: report unhealthy on the status port when the memory usage is too high - #1212

Merged
ti-chi-bot[bot] merged 4 commits into
pingcap:mainfrom
djshow832:report_unhealthy
Sep 10, 2026
Merged

*: report unhealthy on the status port when the memory usage is too high#1212
ti-chi-bot[bot] merged 4 commits into
pingcap:mainfrom
djshow832:report_unhealthy

Conversation

@djshow832

Copy link
Copy Markdown
Collaborator

What problem does this PR solve?

Issue Number: close #1119

Problem Summary:
#1120 only rejects connections when the memory is too high, but it doesn't report unhealthy on the status port.

What is changed and how it works:

  • Add a health manager, which manages the health status
  • The health manager queries the server and memory manager to get the status
  • The API server and proxy server reads the health manager

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
ti-chi-bot Bot requested a review from YangKeao September 10, 2026 12:48
@ti-chi-bot ti-chi-bot Bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Sep 10, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.05634% with 17 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@9031e2d). Learn more about missing BASE report.

Files with missing lines Patch % Lines
cmd/replayer/main.go 0.00% 10 Missing ⚠️
pkg/server/server.go 56.25% 6 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1212   +/-   ##
=======================================
  Coverage        ?   67.71%           
=======================================
  Files           ?      152           
  Lines           ?    16915           
  Branches        ?        0           
=======================================
  Hits            ?    11454           
  Misses          ?     4692           
  Partials        ?      769           
Flag Coverage Δ
unit 67.71% <76.05%> (?)

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

☔ View full report in Codecov by Harness.
📢 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.

@djshow832

Copy link
Copy Markdown
Collaborator Author

/retest

@YangKeao YangKeao left a comment

Copy link
Copy Markdown
Member

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 commented Sep 10, 2026

Copy link
Copy Markdown

[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 Sep 10, 2026
@ti-chi-bot

ti-chi-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

[LGTM Timeline notifier]

Timeline:

  • 2026-09-10 16:22:21.979207278 +0000 UTC m=+1987577.150301394: ☑️ agreed by YangKeao.

@ti-chi-bot ti-chi-bot Bot added the approved label Sep 10, 2026
@ti-chi-bot
ti-chi-bot Bot merged commit 7e5a16e into pingcap:main Sep 10, 2026
8 checks passed
@djshow832
djshow832 deleted the report_unhealthy branch September 10, 2026 23:49
@djshow832

Copy link
Copy Markdown
Collaborator Author

/cherry-pick release-1.3

@ti-chi-bot

ti-chi-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown

@djshow832: The label(s) /release-1.3 cannot be applied, because the repository doesn't have them.

Details

In response to this:

/cherry-pick release-1.3

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 ti-community-infra/tichi repository.

@ti-chi-bot

Copy link
Copy Markdown
Member

@djshow832: new pull request created to branch release-1.3: #1214.
But this PR has conflicts, please resolve them!

Details

In response to this:

/cherry-pick release-1.3

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 ti-community-infra/tichi repository.

djshow832 added a commit to ti-chi-bot/tiproxy that referenced this pull request Sep 11, 2026
Resolve conflicts for release-1.3: drop the meter field, the manual health
override, the ConfigManager interface, and the client-mode replayer cmd that
are absent on this branch. Add UnhealthyReason to HealthInfo so DebugHealth can
report the reason.

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Co-authored-by: Cursor <cursoragent@cursor.com>
@djshow832

Copy link
Copy Markdown
Collaborator Author

/cherry-pick release-nextgen-202603

@ti-chi-bot

ti-chi-bot Bot commented Sep 12, 2026

Copy link
Copy Markdown

@djshow832: The label(s) /release-nextgen-202603 cannot be applied, because the repository doesn't have them.

Details

In response to this:

/cherry-pick release-nextgen-202603

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 ti-community-infra/tichi repository.

@ti-chi-bot

Copy link
Copy Markdown
Member

@djshow832: new pull request created to branch release-nextgen-202603: #1215.

Details

In response to this:

/cherry-pick release-nextgen-202603

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 ti-community-infra/tichi repository.

ti-chi-bot Bot pushed a commit that referenced this pull request Sep 14, 2026
…igh (#1212) (#1215)

Co-authored-by: djshow832 <zhangming@pingcap.com>
ti-chi-bot Bot pushed a commit that referenced this pull request Sep 14, 2026
…igh (#1212) (#1214)

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Co-authored-by: djshow832 <zhangming@pingcap.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reject new connections when the memory usage is high

4 participants