Skip to content

tiup: add the tiup cluster detach-grafana command reference - #22072

Open
time-and-fate wants to merge 8 commits into
pingcap:masterfrom
time-and-fate:261118-detach-grafana
Open

time-and-fate wants to merge 8 commits into
pingcap:masterfrom
time-and-fate:261118-detach-grafana

Conversation

@time-and-fate

@time-and-fate time-and-fate commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

What is changed, added, or deleted? (Required)

Add the reference page for the new tiup cluster detach-grafana command (pingcap/tiup#2750): description, syntax, options, directory-safety checks, and post-handover maintenance notes. The page is linked from the TiUP Cluster command overview, TOC.md, and TOC-pingkai.md.

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

  • 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

Summary by CodeRabbit

  • 文档
    • 新增 tiup cluster detach-grafana 命令文档,并将该命令加入 TiUP Cluster 命令目录。
    • 说明该命令可将已登记的 Grafana 实例移出 TiUP 管理,同时保留实例运行状态和相关文件,不会停止服务。
    • 补充命令的适用条件、目录校验规则、移交后的维护与监控影响,以及校验失败或取消操作时管理信息不会更新的说明。

Document the new detach-grafana command (pingcap/tiup#2750): syntax,
options, directory-safety checks, and post-handover maintenance notes.
Link the page from the TiUP Cluster command overview and both TOCs.
@ti-chi-bot

ti-chi-bot Bot commented Nov 18, 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 qiancai 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/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 18, 2026
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

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

No actionable comments were generated in the recent review.

Walkthrough

新增 tiup cluster detach-grafana 使用文档,并更新 TiUP Cluster 命令摘要和目录。.lycheeignore 新增一条链接忽略规则。

Changes: detach-grafana 命令文档

Layer / File(s) Summary
命令说明与目录更新
tiup/tiup-component-cluster-detach-grafana.md, tiup/tiup-component-cluster.md, TOC.md, TOC-pingkai.md
新增命令文档,说明参数、metadata 更新条件、目录检查及移交后的维护和监控事项。命令摘要和两个目录新增该命令。

链接检查规则

Layer / File(s) Summary
新增链接忽略规则
.lycheeignore
新增对 https://pingkai.cn/tidb-release-support-policy 的匹配规则。

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other

Possibly related issues

Suggested reviewers: qiancai

Merge Risk: Minimal · previous review 2068b

This PR adds a reference page for the new detach-grafana command and links it from the TiUP Cluster overview and the tables of contents. The earlier concern about the TiFlash cache directory check scope has been clarified in the page. No remaining merge-blocking risk is evident.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed 标题“tiup: add the tiup cluster detach-grafana command reference”与变更集的主要内容一致。变更新增了 detach-grafana 命令的参考文档,并在 TOC.md 与 TOC-pingkai.md 中添加链接。标题简洁,指明了主要变更。
Description check Passed 描述基本符合模板。已填写变更内容、适用版本(仅 master)、相关代码 PR 链接(pingcap/tiup#2750)以及 AI 代理参与声明。变更内容一节说明了页面范围及目录链接。第一次贡献者清单为可选项,未勾选 CLA 项,但模板中该部分可删除,不影响判定。描述完整度足够,可通过检查。
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.
Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • 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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 64849b2 and 2068b3a.

Files selected for processing: 1

  • tiup/tiup-component-cluster-detach-grafana.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.

The link returns 403 to GitHub runners while serving 200 to browsers,
and it is pre-existing on master; the changed-file check surfaced it
because this PR touches TOC-pingkai.md.

@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: 4

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 80c7843 and 36b55d0.

Files selected for processing: 4

  • TOC-pingkai.md
  • TOC.md
  • tiup/tiup-component-cluster-detach-grafana.md
  • tiup/tiup-component-cluster.md

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


执行 detach 前,TiUP 会基于本地 metadata 中记录的路径检查目录冲突:

- 如果目标 Grafana 的目录(包括 Grafana 配置中的 `paths.data`、`paths.logs`、`paths.plugins`、`paths.provisioning`)与同一管理主机上仍受管理组件或 exporter 的目录存在重叠(相同、包含或被包含),命令会报错退出,metadata 保持不变。

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

感谢建议。这里的检查范围与 TiUP 实际的清理路径一致,没有失实:当 storage.remote.cache.dir 仅配置在 server_configs.tiflash(实例未覆盖)时,TiUP 的任何清理路径都不会删除该目录——destroy/scale-in 只读取实例配置中的该项,tiup cluster clean 也不清理 cache 目录,因此它不属于「受管理组件会清理的目录」。Grafana 的 paths.* 之所以回退读取 server_configs,是因为 reload/upgrade 会按合并后的配置重写 provisioning 等目录,属于会被写入的一侧。

…tion

Per review: edit-config only changes the local topology, so ask readers
to confirm the remote paths first; the Grafana discovery record lives in
PD's etcd, not in the local metadata.

执行 detach 前,TiUP 会基于本地 metadata 中记录的路径检查目录冲突:

- 如果目标 Grafana 的目录(包括 Grafana 配置中的 `paths.data`、`paths.logs`、`paths.plugins`、`paths.provisioning`)与同一管理主机上仍受管理组件或 exporter 的目录存在重叠(相同、包含或被包含),命令会报错退出,metadata 保持不变。

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

感谢建议。这里的检查范围与 TiUP 实际的清理路径一致,没有失实:当 storage.remote.cache.dir 仅配置在 server_configs.tiflash(实例未覆盖)时,TiUP 的任何清理路径都不会删除该目录——destroy/scale-in 只读取实例配置中的该项,tiup cluster clean 也不清理 cache 目录,因此它不属于「受管理组件会清理的目录」。Grafana 的 paths.* 之所以回退读取 server_configs,是因为 reload/upgrade 会按合并后的配置重写 provisioning 等目录,属于会被写入的一侧。

@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: 2

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between a83a562 and 6def98a.

Files selected for processing: 1

  • tiup/tiup-component-cluster-detach-grafana.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.

Per review: the check matches hosts by the recorded manage-host string,
so the same machine recorded as different addresses in different
clusters is not compared; and instance deploy/log/data values are
resolved against deploy_dir before the check, so only paths that stay
relative or contain shell syntax are rejected.
@time-and-fate

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@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: 2

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 6def98a and 64849b2.

Files selected for processing: 1

  • tiup/tiup-component-cluster-detach-grafana.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.

deploy_dir itself must be absolute while log_dir/data_dir resolve
against it; Grafana paths.* prefer the instance config with a
server_configs fallback, and only the instance-level TiFlash
storage.remote.cache.dir participates in the check.
@time-and-fate

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

- The directory check requires absolute recorded paths verbatim; there is
  no deploy_dir-relative resolution step. Describe the actual rule.
- Explain why the directory conflict check exists: later scale-in,
  destroy, or upgrade may clean up overlapping managed directories.
- Mention the confirmation step in the output section, and that a
  pending two-phase scale-out blocks the command.
- Unify the detach wording and apply minor phrasing fixes.
@ti-chi-bot

ti-chi-bot Bot commented Nov 20, 2026

Copy link
Copy Markdown

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

Details

In response to this:

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.

Cover the Grafana SQLite database file (database.url / database.path)
in the directory-overlap description and note that external database
URLs are out of scope; compare hosts recorded as IP addresses by
value so different IPv6 spellings of one machine count as one host.

Describe the discovery-record semantics introduced with
detached_grafanas: detach records the handed-over instance's address
in the metadata, refreshes preserve the entry while the record exists
and delete it otherwise (including the retry after a failed scale-in
cleanup), adding a managed Grafana replaces the entry and clears the
record, and older TiUP versions do not recognize the record.
State the new preservation rule as one exception plus the usual
maintenance: a topology refresh keeps the discovery record only while
it still points at the detached instance's address; everything else
follows the rules of a cluster that never detached. Aligns the page
with the matching tiup behavior change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing-translation-status This PR does not have translation status info. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants