Skip to content

balance: lower the OOM risk level during TiDB bootstrap#1167

Merged
ti-chi-bot[bot] merged 1 commit into
pingcap:mainfrom
djshow832:oom
Jun 4, 2026
Merged

balance: lower the OOM risk level during TiDB bootstrap#1167
ti-chi-bot[bot] merged 1 commit into
pingcap:mainfrom
djshow832:oom

Conversation

@djshow832
Copy link
Copy Markdown
Collaborator

What problem does this PR solve?

Issue Number: close #848

Problem Summary:
When TiDB starts, the memory usually increases sharply, leading to fake OOM risk. This will cause unnecessary session migrations.

What is changed and how it works:
Adjust the TimeToOOM to timeToOOM = time.Duration(float64(timeToOOM) / latestUsage * 0.6).

  • /latestUsage: the lower the current usage is, the longer the timeToOOM is
  • * 0.6: lower the timeToOOM so that the thresholds don't need to be changed

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 review from bb7133 and xhebox June 4, 2026 07:37
@ti-chi-bot ti-chi-bot Bot added the size/S label Jun 4, 2026
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@99915da). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1167   +/-   ##
=======================================
  Coverage        ?   67.60%           
=======================================
  Files           ?      150           
  Lines           ?    16661           
  Branches        ?        0           
=======================================
  Hits            ?    11264           
  Misses          ?     4636           
  Partials        ?      761           
Flag Coverage Δ
unit 67.60% <100.00%> (?)

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.

Copy link
Copy Markdown
Member

@YangKeao YangKeao 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 lgtm label Jun 4, 2026
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Jun 4, 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
Copy link
Copy Markdown

ti-chi-bot Bot commented Jun 4, 2026

[LGTM Timeline notifier]

Timeline:

  • 2026-06-04 07:58:22.831169448 +0000 UTC m=+428403.901486828: ☑️ agreed by YangKeao.

@ti-chi-bot ti-chi-bot Bot added the approved label Jun 4, 2026
@ti-chi-bot ti-chi-bot Bot merged commit 9798547 into pingcap:main Jun 4, 2026
6 checks passed
@djshow832 djshow832 deleted the oom branch June 4, 2026 08:05
@djshow832
Copy link
Copy Markdown
Collaborator Author

/cherry-pick release-1.3

@ti-chi-bot
Copy link
Copy Markdown
Member

@djshow832: new pull request created to branch release-1.3: #1168.

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 Bot pushed a commit that referenced this pull request Jun 4, 2026
Co-authored-by: djshow832 <zhangming@pingcap.com>
@djshow832
Copy link
Copy Markdown
Collaborator Author

/cherry-pick release-nextgen-202603

@ti-chi-bot
Copy link
Copy Markdown
Member

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

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 Jun 5, 2026
Co-authored-by: djshow832 <zhangming@pingcap.com>
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.

Ignore the backend memory increase at startup

4 participants