Skip to content

tidb: enable global memory arbitration in priority mode by default - #21827

Open
solotzg wants to merge 18 commits into
masterfrom
solotzg-patch-1
Open

solotzg wants to merge 18 commits into
masterfrom
solotzg-patch-1

Conversation

@solotzg

@solotzg solotzg commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

First-time contributors' checklist

What is changed, added or deleted? (Required)

  • Update the system variable documentation to change the default value of tidb_mem_arbitrator_mode from disable to priority.
  • Update the memory usage guide to explain that the high-memory usage alarm does not apply when memory arbitration is enabled.
  • Document automatic heap profile collection for memory diagnosis.
  • Clarify the mem-risk and oom-risk event metrics in the memory arbitration monitoring section.

Which TiDB version(s) do your changes apply to? (Required)

Tips for choosing the affected version(s):

By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.

For details, see tips for choosing the affected versions (in Chinese).

  • master (the latest development version)
  • v9.0 (TiDB 9.0 versions)
  • v8.5 (TiDB 8.5 versions)
  • v8.1 (TiDB 8.1 versions)
  • v7.5 (TiDB 7.5 versions)
  • v7.1 (TiDB 7.1 versions)
  • v6.5 (TiDB 6.5 versions)

What is the related PR or file link(s)?

AI agent involvement

  • The changes in this PR were primarily made by an AI agent on behalf of the PR author.

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

@ti-chi-bot ti-chi-bot Bot added missing-translation-status This PR does not have translation status info. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 22, 2026
@coderabbitai

coderabbitai Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
Walkthrough

文档将系统变量 tidb_mem_arbitrator_mode 的默认值从 disable 更新为 priority,并移除 disable 枚举项的默认值标注。

Changes: 系统变量文档

Layer / File(s) Summary
更新内存仲裁模式默认值
system-variables.md
将 tidb_mem_arbitrator_mode 的默认值更新为 priority,并移除 disable 条目的默认值标注;可选值及模式描述保持不变。

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: qiancai, lilin90, guo-shaoge

Pre-merge checks: Passed 4

Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed 标题准确指出了默认模式改为 priority 的变更。
Description check Passed 描述已填写变更内容、适用版本和相关链接,基本符合模板。版本选择存在不一致:描述勾选了 master 和 v9.0,但 PR 目标说明仅针对 master。
Finishing Touches

Generate docstrings

  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)

  • Create PR with unit tests
  • Commit unit tests in branch solotzg-patch-1
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 48be1509-3e46-4b1b-ac00-22e2be2cf8a3

📥 Commits

Reviewing files that changed from the base of the PR and between bf5af3c and 7e1af04.

📒 Files selected for processing (1)
  • system-variables.md

Comment thread system-variables.md Resolved
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: fb5e85df-47b0-4576-9668-7fb6bbb3977b

📥 Commits

Reviewing files that changed from the base of the PR and between 7e1af04 and a4b7974.

📒 Files selected for processing (1)
  • system-variables.md

Comment thread system-variables.md Resolved
Add default and optional values for memory management variable.
@solotzg solotzg changed the title Update system-variables.md tidb: enable global memory arbitration in priority mode by default Jul 24, 2026
Comment thread system-variables.md
- 是否受 Hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value) 控制:否
- 类型:枚举型
- 默认值:`disable`
- 默认值:`priority`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

改了默认值后,相当于这个功能在所有环境都默认开启了,那前面的 “该变量控制的功能为实验特性,不建议在生产环境中使用” 还需要保留吗,有些矛盾

@solotzg solotzg Jul 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

该功能在 master 分支已经 GA。2603 和 2609 仍旧保持关闭,实验特性的警告还是需要的。

@qiancai qiancai self-assigned this Jul 25, 2026
@qiancai qiancai added the translation/doing This PR’s assignee is translating this PR. label Jul 25, 2026
@ti-chi-bot ti-chi-bot Bot removed the missing-translation-status This PR does not have translation status info. label Jul 25, 2026
@qiancai qiancai added the v9.0-beta.3 This PR/issue applies to TiDB v9.0-beta.3. label Jul 25, 2026
@solotzg
solotzg marked this pull request as draft October 30, 2026 08:50
@ti-chi-bot ti-chi-bot Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 30, 2026
Removed warning messages about experimental features for several system variables.
@ti-chi-bot

ti-chi-bot Bot commented Oct 30, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from qiancai. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found 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 size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 30, 2026
Removed warning about experimental feature in memory arbitration mode documentation.
Clarified conditions for TiDB memory usage alerts and introduced memory arbitration mode details.
@ti-chi-bot ti-chi-bot Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 3, 2026
Comment thread configure-memory-usage.md Resolved
Comment thread configure-memory-usage.md Resolved
Comment thread configure-memory-usage.md Resolved
@ti-chi-bot ti-chi-bot Bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 6, 2026
Comment thread system-variables.md Resolved
Reintroduced automatic heap profile collection details after enabling memory arbitration mode, including thresholds and file storage information.
@solotzg
solotzg marked this pull request as ready for review November 6, 2026 09:49
@ti-chi-bot ti-chi-bot Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 6, 2026
Corrected version numbers for memory arbitration mode introduction and clarified issues with previous memory control mechanisms.
Clarify the description of 'Events' in memory arbitration statistics.
Comment thread configure-memory-usage.md Resolved
@solotzg
solotzg requested a review from qiancai November 6, 2026 13:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

内存诊断文档仍未注明旧报警示例需要禁用内存仲裁,也遗漏了未配置日志目录时的诊断文件回退路径,可能导致用户无法找到预期记录。

2 open issues
What changed in this PR

This PR updates the Chinese TiDB documentation for priority-based memory arbitration becoming the default, aligning the variable reference and memory diagnosis guide.

Changes:

  • Changes the documented default of tidb_mem_arbitrator_mode to priority.
  • Documents automatic heap profile collection, including thresholds, storage, and retention.
  • Clarifies that mem-risk and oom-risk metrics count risk-handling events.
File Description
system-variables.md Updates the memory arbitration default and mode descriptions.
configure-memory-usage.md Expands heap profile guidance and clarifies arbitration event metrics.

Review effort: Balanced

Comment thread configure-memory-usage.md Resolved
Comment thread system-variables.md Resolved

@windtalker windtalker left a comment

Copy link
Copy Markdown
Contributor

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 Nov 10, 2026

Copy link
Copy Markdown

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

Details

In response to this:

lgtm

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.

@solotzg

solotzg commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

@qiancai PTAL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Denotes a PR that changes 10-29 lines, ignoring generated files. translation/doing This PR’s assignee is translating this PR. v9.0-beta.3 This PR/issue applies to TiDB v9.0-beta.3.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants