Skip to content

check-before-deployment: fix TuneD custom profile path - #21925

Open
doc-claw-bot wants to merge 4 commits into
pingcap:release-8.5from
doc-claw-bot:docs-cn/fix-tuned-profile-path
Open

doc-claw-bot wants to merge 4 commits into
pingcap:release-8.5from
doc-claw-bot:docs-cn/fix-tuned-profile-path

Conversation

@doc-claw-bot

@doc-claw-bot doc-claw-bot commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

What is changed, added or deleted? (Required)

  • Clarify the TuneD custom profile path in check-before-deployment.md.
  • Add version-specific command examples for both path formats:
    • TuneD earlier than v2.23.0: /etc/tuned/<profile_name>/tuned.conf
    • TuneD v2.23.0 and later: /etc/tuned/profiles/<profile_name>/tuned.conf
  • Explain that each path format is only recognized by its corresponding TuneD version range.

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)
  • v8.5 (TiDB 8.5 versions)
  • v8.4 (TiDB 8.4 versions)
  • v8.3 (TiDB 8.3 versions)
  • v8.2 (TiDB 8.2 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

Summary by CodeRabbit

  • 文档
    • 更新 TuneD 自定义策略的配置路径说明。
    • 补充版本差异:TuneD v2.23.0 之前使用 /etc/tuned/<profile_name>/tuned.conf,v2.23.0 及以上使用 /etc/tuned/profiles/<profile_name>/tuned.conf
    • 明确两种路径格式仅适用于对应版本,避免自定义策略无法被识别。

@ti-chi-bot ti-chi-bot Bot added the contribution This PR is from a community contributor. label Sep 8, 2026
@ti-chi-bot

ti-chi-bot Bot commented Sep 8, 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 assign csuzhangxc for approval. 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 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 Sep 8, 2026
@doc-claw-bot doc-claw-bot added type/bugfix This PR fixes a bug. translation/from-docs This PR is translated from a PR in pingcap/docs. needs-cherry-pick-master Should cherry pick this PR to master branch. and removed missing-translation-status This PR does not have translation status info. labels Sep 8, 2026
@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Review Change StackReview 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

Walkthrough

更新 TuneD 自定义策略的目录路径,并补充 TuneD v2.23.0 前后的版本要求。

Changes

TuneD 策略路径

Layer / File(s) Summary
更新自定义策略路径
check-before-deployment.md
TuneD v2.23.0 之前使用 /etc/tuned/balanced-tidb-optimal/。TuneD v2.23.0 及以上版本使用 /etc/tuned/profiles/balanced-tidb-optimal/。两种路径不能跨版本使用。

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

Merge Risk: 🔵 Low · up to 3e69a

The documentation correctly distinguishes the default TuneD paths by version, but users with customized profile directories may create profiles in a location TuneD does not scan. Clarify that the paths apply to default configuration before merging.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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 标题准确概括了主要变更:修复 TuneD 自定义 profile 路径。标题简洁且具体。
Description check ✅ Passed 描述包含变更内容、适用版本、相关链接、AI 参与情况和其他检查项。内容与 PR 目标一致,满足模板的关键要求。
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 42d11119-22f9-44e3-abc1-09679ad14552

📥 Commits

Reviewing files that changed from the base of the PR and between 0b6ace9 and e937ccd.

📒 Files selected for processing (1)
  • check-before-deployment.md

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Comment thread check-before-deployment.md Outdated
qiancai and others added 2 commits September 8, 2026 16:14
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@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 Sep 8, 2026

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 461df81d-91f8-47cb-b8b6-ceaba396076d

📥 Commits

Reviewing files that changed from the base of the PR and between 52ca8ab and 3e69a1b.

📒 Files selected for processing (1)
  • check-before-deployment.md

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Comment thread check-before-deployment.md Outdated
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@mahjonp

mahjonp commented Sep 20, 2026

Copy link
Copy Markdown

[P2] 建议调整按 TuneD 版本选择策略目录的说明:发行版可能保留旧目录。

针对当前提交 b3e55f6第 520–527 行,补充新版目录的方向是合理的,但“默认配置下,v2.23.0 及以上版本使用 /etc/tuned/profiles/”仍不适用于所有发行版。“如果修改了 profile_dirs”也无法覆盖发行版自带的默认行为。

已检查 Rocky Linux 9 官方发布的 tuned-2.27.0-2.el9_8.noarch.rpm。包内 consts.py 的实际默认值是:

USER_PROFILES_DIR = "/etc/tuned"
SYSTEM_PROFILES_DIR = "/usr/lib/tuned"
CFG_DEF_PROFILE_DIRS = [SYSTEM_PROFILES_DIR, USER_PROFILES_DIR]

随包的 tuned-main.confprofile_dirs 仍被注释,没有显式覆盖。使用包内原始 Locator 代码、将默认搜索路径映射到临时目录后,验证结果为:

配置文件位置 查找结果
/etc/tuned/profiles/balanced-tidb-optimal/tuned.conf get_config() 返回 None,策略列表中不可见
/etc/tuned/balanced-tidb-optimal/tuned.conf 能找到,策略列表中可见

验证范围是实际 RPM 内容和策略查找逻辑,未启动完整 TuneD 服务。这个反例说明,用户按当前“≥2.23”示例创建策略后,可能无法应用该策略。RHEL 9 官方文档也明确使用 /etc/tuned/上游 v2.25.1 的 RPM 规则rhel < 10 保留旧目录,安装逻辑会将其写入代码默认值。

建议做以下修改:

  1. 将路径选择依据改为本机安装包及实际配置,版本信息只用于说明上游变化。第 2 步开头及注意事项可改为:

    创建新的 tuned 策略。先通过本机 man tuned.conf 确认自定义策略的默认目录。如果在 /etc/tuned/tuned-main.conf 中显式设置了 profile_dirs,则以该配置指定的搜索目录为准。

    注意: 上游 TuneD 从 v2.23.0 起,将自定义策略的默认目录从 /etc/tuned/ 调整为 /etc/tuned/profiles/。部分发行版(例如 RHEL 9、Rocky Linux 9)仍保留 /etc/tuned/,即使其 TuneD 版本不低于 v2.23.0。因此,不能仅根据版本号选择目录。被注释的 profile_dirs 不代表显式配置。

  2. 将两组 mkdir/vi 命令拆成独立代码块,分别标注“如果自定义策略目录为 /etc/tuned/”和“如果自定义策略目录为 /etc/tuned/profiles/”,并明确仅执行对应的一组;如果配置了其他目录,则相应替换路径。

  3. 保存 tuned.conf 后、应用策略前,增加 tuned-adm list,确认列表中包含 balanced-tidb-optimal;如果未出现,先检查保存路径是否位于实际策略搜索目录中。

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

Labels

contribution This PR is from a community contributor. needs-cherry-pick-master Should cherry pick this PR to master branch. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. translation/from-docs This PR is translated from a PR in pingcap/docs. type/bugfix This PR fixes a bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants