Skip to content

Conversation

qiancai
Copy link
Owner

@qiancai qiancai commented Sep 15, 2025

First-time contributors' checklist

What is changed, added or deleted? (Required)

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)
  • v6.1 (TiDB 6.1 versions)
  • v5.4 (TiDB 5.4 versions)

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

  • This PR is translated from:
  • Other reference link(s):

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

  • Documentation
    • Retitled and refocused the TiDB command-line parameters page; added overview, default ports (4000 client, 10080 status) and an embedded training video.
    • Clarified CLI flags with explicit defaults/usages (hosts, advertise address, config precedence, initialize-sql, logging level, status port, removed insecure/init and socket options).
    • Added three per-store PD scheduling options (min-snapshot-rate, min-pending-peer-count, min-pending-learner-count; default 10), introduced read-per-batch-base-cost, and renamed read-cpu-ms-cost → read-cpu-ms-cost-pu.
    • Swapped two TSO certificate headers for correctness and adjusted the metric section header text.

Copy link

coderabbitai bot commented Sep 15, 2025

Walkthrough

Updated three documentation pages: TiDB CLI flags retitled and reorganized (intro, defaults, renamed/added/removed flags, status/logging details); PD scheduling docs add three per-store lower-bound options and RU cost tweaks; TSO config swaps cert-path/cacert-path labels and adjusts the metric section header.

Changes

Cohort / File(s) Summary of Changes
Docs: TiDB CLI flags
command-line-flags-for-tidb-configuration.md
Retitled page; added intro with default ports (4000 client, 10080 status) and embedded training video; clarified config-file vs CLI precedence (config read first, CLI overrides); renamed/added flags (e.g., --host--hosts, --file, --cors, --initialize-sql), expanded logging flag (-L log level with allowed values `debug
Docs: PD scheduling options
pd-configuration-file.md
Added three per-store lower-bound scheduling options under schedule: min-snapshot-rate, min-pending-peer-count, min-pending-learner-count (each default 10). Renamed read-cpu-ms-costread-cpu-ms-cost-pu, added read-per-batch-base-cost (default 0.5), retained max-snapshot-count (64) and write-cost notes. No code/API changes.
Docs: TSO configuration
tso-configuration-file.md
Swapped headers/descriptions for TLS entries: cacert-path and cert-path labels/descriptions exchanged (semantics swapped). Changed the metric section header text (e.g., from Chinese descriptive header to use metric in header). Other sections (key-path, redact-info-log, log) unchanged.

Sequence Diagram(s)

sequenceDiagram
    participant Admin
    participant TiDB as TiDB Process
    participant Config as Config File
    participant Metrics as Prometheus/pprof

    rect rgb(220,235,255)
    Admin->>TiDB: start TiDB with CLI flags
    TiDB->>Config: read config file (first)
    Config-->>TiDB: return config values
    TiDB->>TiDB: apply CLI flags (override config)
    end

    alt first startup with --initialize-sql
      TiDB->>TiDB: execute SQL from `--initialize-sql`
    end

    TiDB->>Admin: bind to `--hosts` / `--file` (default 0.0.0.0)
    TiDB->>Metrics: expose /metrics and /debug/pprof on `--status` (default 10080)
    Metrics-->>Admin: metrics & pprof endpoints available
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

I hop through docs with tiny paws and grin,
Ports and flags tucked neatly in my bin.
Certs swapped places, snapshots set to ten,
Logs hum softly as the changes pen.
A carrot for each updated line—chin-chin 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description is effectively the untouched repository template with required fields left blank: the "What is changed, added or deleted?" section is empty, no affected-version checkboxes are selected, and the CLA checkbox is unchecked; the CLA assistant also reports the contributor has not signed the CLA. Because the template fields required for reviewers and release assignment are missing, the description is incomplete and does not meet the repository's PR requirements. This prevents proper review and blocks merge progress. Please complete the PR description by filling the "What is changed, added or deleted?" section with a concise summary including the modified files (for example command-line-flags-for-tidb-configuration.md, pd-configuration-file.md, tso-configuration-file.md), select the affected TiDB version(s) (at minimum check "master" if applicable), and add any related PR/file links; also sign the Contributor License Agreement so the CLA assistant shows "signed," then request a CLA recheck and re-review.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The PR title "test: Update command-line-flags-for-tidb-configuration.md" names the primary file changed and therefore is related to the main changeset described in the raw_summary, but the "test:" prefix and a filename-based phrasing reduce clarity and make the intent less immediately readable to reviewers. A concise, descriptive title focused on the substantive change would be clearer.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch test-update

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4bc9196 and 591a062.

📒 Files selected for processing (1)
  • tso-configuration-file.md (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • tso-configuration-file.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: pull

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 and usage tips.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (6)
command-line-flags-for-tidb-configuration.md (6)

120-139: Add version notes for PROXY fallback flag

--proxy-protocol-fallbackable was introduced around v6.5.1 (config counterpart). Add a brief version hint to reduce confusion on older clusters. (docs.pingcap.com)

 ## `--proxy-protocol-fallbackable`
 
-+ 用于控制是否启用 PROXY 协议回退模式。如果设置为 `true`,TiDB 可以接受属于 `--proxy-protocol-networks` 的客户端使用非 PROXY 协议规范或者没有发送 PROXY 协议头的客户端连接。默认情况下,TiDB 仅接受属于 `--proxy-protocol-networks` 的客户端发送 PROXY 协议头的客户端连接。
++ 用于控制是否启用 PROXY 协议回退模式(从 v6.5.1 起可用)。如果设置为 `true`,TiDB 可以接受属于 `--proxy-protocol-networks` 的客户端使用非 PROXY 协议规范或者没有发送 PROXY 协议头的客户端连接。默认情况下,TiDB 仅接受属于 `--proxy-protocol-networks` 的客户端发送 PROXY 协议头的客户端连接。
 + 默认:`false`

140-153: Clarify unit; keep deprecation note

Consider making the unit explicit in Default to avoid ambiguity and align with upstream phrasing. The deprecation warning since v6.3.0 is correct. (docs.pingcap.com)

-+ 默认:5
-+ 单位:秒
++ 默认:5s(秒)

171-179: Capitalize Prometheus consistently

Use “Prometheus” with capital P in both the bullet and link text. (docs.pingcap.com)

-+ 该端口用于展示 TiDB 内部数据,包括 [prometheus 统计](https://prometheus.io/)和 [pprof](https://golang.org/pkg/net/http/pprof/)
++ 该端口用于展示 TiDB 内部数据,包括 [Prometheus 指标](https://prometheus.io/)和 [pprof](https://golang.org/pkg/net/http/pprof/)

191-195: Unify list marker style

This section uses “-” while most others use “+”. Pick one consistently to reduce diff noise in future edits.

-## `--temp-dir`
-
-- TiDB 用于存放临时文件的目录
-- 默认:"/tmp/tidb"
+## `--temp-dir`
+
++ TiDB 用于存放临时文件的目录
++ 默认:"/tmp/tidb"

198-200: Version anchor is good; optional inline hint

You already link to the variable with version info. Optionally echo “从 v7.4.0 开始引入” inline to help readers who won’t follow the link. (docs.pingcap.com)

-+ 用于设置当前 TiDB 实例 [`tidb_service_scope`](/system-variables.md#tidb_service_scope-从-v740-版本开始引入) 的初始值。
++ 用于设置当前 TiDB 实例 [`tidb_service_scope`](/system-variables.md#tidb_service_scope-从-v740-版本开始引入) 的初始值(从 v7.4.0 起引入)。

112-119: Minor example tweak: avoid spaces in PD address list

Although spaces in the quoted example are accepted, removing them reduces copy/paste surprises in scripts.

-+ 对于 "TiKV" 存储引擎来说,path 指定的是实际的 PD 地址。假如在 192.168.100.113:2379、192.168.100.114:2379 和 192.168.100.115:2379 上面部署了 PD,那么 path 为 "192.168.100.113:2379, 192.168.100.114:2379, 192.168.100.115:2379"
++ 对于 "TiKV" 存储引擎来说,path 指定的是实际的 PD 地址。假如在 192.168.100.113:2379、192.168.100.114:2379 和 192.168.100.115:2379 上部署了 PD,那么 path 为 "192.168.100.113:2379,192.168.100.114:2379,192.168.100.115:2379"
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d549f4b and ef8fe90.

📒 Files selected for processing (1)
  • command-line-flags-for-tidb-configuration.md (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: pull
🔇 Additional comments (6)
command-line-flags-for-tidb-configuration.md (6)

9-10: Defaults confirmation looks good

Default ports 4000 (client) and 10080 (status) match the current docs. (docs.pingcap.com)


27-28: Config precedence wording is accurate

“命令行覆盖配置文件”与官方说明一致。 (docs.pingcap.com)


31-38: Link to the right config file doc; keep phrasing consistent

The behavior of --config-check/--config-strict matches upstream. Ensure the link /tidb-configuration-file.md resolves in this repo’s structure. (docs.pingcap.com)


50-64: Initialize flags are valid; summary above is inconsistent

These initialize flags are still documented in stable and recent versions; keeping them here is correct. The AI summary claiming they were removed is inaccurate. (docs.pingcap.com)


227-232: Redaction section matches upstream; keep as-is

The --redact and collect-log behavior matches the latest stable docs. No change needed. (docs.pingcap.com)


2-5: Front matter: tighten summary; confirm aliases

  • Replace the verbose summary with the concise line below.
  • Confirm the front-matter aliases map to the intended published paths (dev/stable/versioned). Repo check: system-variables.md and tidb-configuration-file.md exist and tidb_service_scope anchors are referenced in multiple files, but the /docs-cn/... alias redirects were not validated — verify or update/remove the aliases.
-summary: TiDB 配置参数包括启动参数和环境变量。启动参数包括 advertise-address、config、config-check、config-strict、cors 等。其中默认端口为 4000 和 10080。其他参数包括 log-file、metrics-addr、metrics-interval 等。注意配置文件的有效性和安全模式下的启动。
+summary: 介绍 TiDB 的命令行启动参数与默认端口(4000、10080),及常用选项(如 advertise-address、config、日志、代理与状态端口等),并说明配置文件与命令行的优先级与安全注意事项。

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
command-line-flags-for-tidb-configuration.md (2)

55-64: --initialize-insecure / --initialize-secure are not TiDB server flags.

These appear to be introduced erroneously. Keeping them will cause users to pass unknown flags.

Apply:

-## `--initialize-insecure`
-
-- 在不安全模式下启动 tidb-server
-- 默认:true
-
-## `--initialize-secure`
-
-- 在安全模式下启动 tidb-server
-- 默认:false

65-69: Scope correction: initialize-sql-file is a config-file option, not a CLI flag.

Present it as a config entry; avoid implying a --initialize-sql-file CLI flag exists.

Apply:

-## `--initialize-sql-file`
-
-- 用于指定 TiDB 集群初次启动时执行的 SQL 脚本。参考[配置项 `initialize-sql-file`](/tidb-configuration-file.md#initialize-sql-file-从-v660-版本开始引入)
-- 默认:""
+### 配置文件项:`initialize-sql-file`
+
+- 指定 TiDB 集群初次启动时执行的 SQL 脚本(仅配置文件支持,无等价 CLI 参数)。参考[配置项 `initialize-sql-file`](/tidb-configuration-file.md#initialize-sql-file-从-v660-版本开始引入)。
🧹 Nitpick comments (3)
command-line-flags-for-tidb-configuration.md (3)

124-129: Clarify --path default scope (varies by --store).

The default “/tmp/tidb” applies to store=unistore only; for tikv, --path must be PD endpoints and has no meaningful filesystem default.

Apply:

-+ 默认:"/tmp/tidb"
-+ 可以通过 `tidb-server --store=unistore --path=""` 来启动一个纯内存引擎的 TiDB
++ 默认(当 `--store=unistore` 时):"/tmp/tidb"
++ 当 `--store=tikv` 时,必须显式指定为 PD 地址列表(无本地路径默认值)。
++ 可以通过 `tidb-server --store=unistore --path=""` 启动纯内存引擎。

176-183: Update pprof reference link to the current Go documentation site.

Minor docs freshness tweak.

Apply:

-+ 该端口用于展示 TiDB 内部数据,包括 [prometheus 统计](https://prometheus.io/)和 [pprof](https://golang.org/pkg/net/http/pprof/)
++ 该端口用于展示 TiDB 内部数据,包括 [Prometheus 统计](https://prometheus.io/)和 [pprof](https://pkg.go.dev/net/http/pprof)

4-4: Summary mentions “安全模式下的启动” but related flags are invalid. Remove that hint.

Avoid referencing non-existent secure/unsafe init modes.

Apply:

-summary: TiDB 配置参数包括启动参数和环境变量。启动参数包括 advertise-address、config、config-check、config-strict、cors 等。其中默认端口为 4000 和 10080。其他参数包括 log-file、metrics-addr、metrics-interval 等。注意配置文件的有效性和安全模式下的启动。
+summary: TiDB 配置参数包括启动参数和环境变量。启动参数包括 advertise-address、config、config-check、config-strict、cors 等。其中默认端口为 4000 和 10080。其他参数包括 log-file、metrics-addr、metrics-interval 等。请注意配置文件的有效性与参数优先级。
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ef8fe90 and 914c654.

📒 Files selected for processing (1)
  • command-line-flags-for-tidb-configuration.md (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: pull
🔇 Additional comments (4)
command-line-flags-for-tidb-configuration.md (4)

31-37: Good: --config-check / --config-strict phrasing and cross-links.

Accurate and helpful. No changes needed.


231-236: Confirm collect-log subcommand usage under --redact — confirmed. Verified: invocation is ./tidb-server --redact=<true|false> collect-log <input> <output>; --redact=true masks fields wrapped in ‹ › (replaced with ?), --redact=false restores/removes the markers.


216-220: Confirm --plugin-dir default

TiDB docs list tidb-server --plugin-dir default as "/data/deploy/plugin"; the SQL system variable plugin_dir defaults to an empty string.


191-194: Default store is "unistore" — verified.
Official TiDB docs show tidb-server --store defaults to "unistore" for stable (including v7.x/v8.x); TiUP starting TiKV by default is a deployment-tool choice, not a change to this flag.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tso-configuration-file.md (1)

128-132: Remove stray metrics interval from log.file section (metrics block was removed).

“向 Prometheus 推送监控指标数据的间隔时间” 属于 metrics/metric 配置,而不是 log.file。当前 PR 摘要称 metrics 段已删除;保留该段会造成读者混淆。

-### `interval`
-
-- 向 Prometheus 推送监控指标数据的间隔时间。
-- 默认:15s

If metrics 配置仍应保留,请改为单独的 “## metrics” 小节并完整说明所有相关键;否则如上删除。

🧹 Nitpick comments (5)
tso-configuration-file.md (5)

45-50: “Primary Key 租约”表述不当,易被理解为数据库主键。

应为 “Primary(主节点)租约/选主租约”,与 TSO 主从角色一致。

- TSO Primary Key 租约超时时间,超时系统重新选举 Primary。
+ TSO Primary(主节点)租约超时时间,超时后系统将重新选举 Primary。

118-127: 统一“默认/默认值”表述风格。

本文件多数使用“默认值:”,此处使用了“默认:”。建议统一。

- 如果未设置本参数或把本参数设置为默认值 `0`,TSO 节点不清理日志文件。
-- 默认:0
+ 如果未设置本参数或把本参数设置为默认值 `0`,TSO 节点不清理日志文件。
+ - 默认值:0

- 如果未设置本参数或把本参数设置为默认值 `0`,TSO 节点会保留所有的日志文件。
-- 默认:0
+ 如果未设置本参数或把本参数设置为默认值 `0`,TSO 节点会保留所有的日志文件。
+ - 默认值:0

29-31: 措辞微调:更自然的中文表述。

“监听的客户端 URL”略别扭,建议改为“客户端访问的监听地址(URL)”。

-- TSO 节点监听的客户端 URL。
+- TSO 节点客户端访问的监听地址(URL)。

40-44: 措辞微调:不是“监听其他节点”。

这里是“用于连接/发现其他 TSO 节点的 URL 列表”,而非“监听”。

-- TSO 节点监听其他 TSO 节点的 URL 列表。
+- 用于与其他 TSO 节点通信的 URL 列表。

63-71: Confirmed cert-path/cacert-path semantics — apply wording tweak.

Verified against PD/TiDB/TiKV docs: cert-path = node/service X.509 证书(PEM);key-path = 对应私钥(PEM);cacert-path = 用于验证对端证书链的 CA 根/中间证书(PEM)。

File: tso-configuration-file.md Lines: 63-71

-### `cert-path`
-- 包含 X.509 证书的 PEM 文件路径
+### `cert-path`
+- 节点/服务端证书(X.509)PEM 文件路径

-### `cacert-path`
-- CA 文件路径
+### `cacert-path`
+- CA 根证书(X.509)PEM 文件路径
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 86f4796 and 4bc9196.

📒 Files selected for processing (1)
  • tso-configuration-file.md (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: pull
🔇 Additional comments (1)
tso-configuration-file.md (1)

27-31: 确认:PD 默认 client-urls 为 http://127.0.0.1:2379,TSO 默认 listen-addr 为 http://127.0.0.1:3379;advertise- 默认与对应地址相同,Docker 示例 advertise 可为 http://192.168.100.113:2379/3379,Docker 下 listen 应设为 0.0.0.0。*

结论:文档中使用的 2379(PD)和 3379(TSO)端口与官方文档一致,无需修改。
位置:tso-configuration-file.md 行 27-31、40-44

github-actions bot added a commit to qiancai/docs that referenced this pull request Sep 26, 2025
  Synced from: qiancai/docs-cn#14
  Target PR: #42
  AI Provider: gemini

  Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants