-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lightning: reformat TiDB Lightning config #19167
base: master
Are you sure you want to change the base?
Conversation
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold |
08f842c
to
5241a65
Compare
- 默认值为 `"false"`,表示通过 TiDB Lightning 下发 `ADMIN CHECKSUM TABLE <table>` 命令给 TiKV 执行。 | ||
- 建议将该值设为 `"true"`,以便在 checksum 失败时更容易定位问题。当该值为 `"true"` 时,如果需要调整并发,请在 TiDB 中设置 [`tidb_checksum_table_concurrency`](/system-variables.md#tidb_checksum_table_concurrency) 变量。 | ||
- 默认值:`"false"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 默认值为 `"false"`,表示通过 TiDB Lightning 下发 `ADMIN CHECKSUM TABLE <table>` 命令给 TiKV 执行。 | |
- 建议将该值设为 `"true"`,以便在 checksum 失败时更容易定位问题。当该值为 `"true"` 时,如果需要调整并发,请在 TiDB 中设置 [`tidb_checksum_table_concurrency`](/system-variables.md#tidb_checksum_table_concurrency) 变量。 | |
- 默认值:`"false"` | |
- 默认值:`"false"` | |
- 可选值: | |
- `"false"`:表示通过 TiDB Lightning 下发 `ADMIN CHECKSUM TABLE <table>` 命令给 TiKV 执行。 | |
- `"true"`:当该值为 `"true"` 时,如果要调整并发,需要在 TiDB 中设置 [`tidb_checksum_table_concurrency`](/system-variables.md#tidb_checksum_table_concurrency) 系统变量。 | |
- 建议将该值设为 `"true"`,以便在执行 CHECKSUM 失败时更容易定位问题。 |
#### `check-disk-quota` | ||
|
||
- 使用物理导入模式时,检查本地磁盘配额的时间间隔。 | ||
- 默认值:`"60s"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
取值范围?
|
||
- 物理导入模式下,向 TiKV 发送数据时一次请求中最大 KV 数量。 | ||
|
||
<!-- 示例值:32768 --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
默认值?
- 如果“导入”更快,区块大小的差异就会更小;比值为 0 时则说明区块大小一致。 | ||
- 取值范围:`[0, 1)` | ||
|
||
<!-- 示例值:`0.75` --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
默认值?
- 设置 TiDB 会话变量,提升 Checksum 和 Analyze 的速度。详情参考[控制 `ANALYZE` 并发度](/statistics.md#控制-analyze-并发度)。 | ||
- 如果将 [`checksum-via-sql`](#checksum-via-sql) 设置为 `"true"`,则会通过 TiDB 执行 `ADMIN CHECKSUM TABLE <table>` SQL 语句来进行 Checksum 操作。在这种情况下,`distsql-scan-concurrency` 参数设置不会生效 | ||
|
||
<!-- 示例值:`15` --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
默认值?
|
||
- 设置 TiDB 会话变量,提升 Checksum 和 Analyze 的速度。详情参考[控制 `ANALYZE` 并发度](/statistics.md#控制-analyze-并发度)。 | ||
|
||
<!-- 示例值:`20` --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
系统变量 tidb_build_stats_concurrency 的默认值是 2,是否需要和这个配置项的默认值相同?
|
||
设置其他 TiDB 会话变量。 | ||
|
||
#### `tidb_enable_clustered_index` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这是个系统变量,好像应该删掉?可能在以前的文档里只是举例。
|
||
- 解析和执行 SQL 语句的默认 SQL 模式。 | ||
|
||
<!-- 示例值:`"ONLY_FULL_GROUP_BY,NO_AUTO_CREATE_USER"` --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
默认值和可选值?
- 设置数据库连接允许的最大数据包大小,对应于系统参数中的 `max_allowed_packet`。 | ||
- 如果设置为 `0`,会使用下游数据库 global 级别的 `max_allowed_packet`。 | ||
|
||
<!-- 示例值:`67_108_864` --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
取值范围和默认值?
- 可选值: | ||
- `"required"`:在导入完成后执行 CHECKSUM 检查,如果 CHECKSUM 检查失败,则会报错退出 | ||
- `"optional"`:在导入完成后执行 CHECKSUM 检查,如果报错,会输出一条 WARN 日志并忽略错误 | ||
- `"off"`:导入结束后不执行 CHECKSUM 检查 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 可选值: | |
- `"required"`:在导入完成后执行 CHECKSUM 检查,如果 CHECKSUM 检查失败,则会报错退出 | |
- `"optional"`:在导入完成后执行 CHECKSUM 检查,如果报错,会输出一条 WARN 日志并忽略错误 | |
- `"off"`:导入结束后不执行 CHECKSUM 检查 | |
- 可选值: | |
- `"required"`:在导入完成后执行 CHECKSUM 检查,如果 CHECKSUM 检查失败,则会报错退出 | |
- `"optional"`:在导入完成后执行 CHECKSUM 检查,如果报错,会输出一条 WARN 日志并忽略错误 | |
- `"off"`:导入结束后不执行 CHECKSUM 检查 |
|
||
- TiDB Lightning 自动刷新导入模式状态的持续时间,该值应小于 TiKV 对应的设定值。 | ||
|
||
<!-- 示例值:`"5m"` --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
默认值和取值范围?
|
||
- 在日志中打印导入进度的持续时间。 | ||
|
||
<!-- 示例值:`"5m"` --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
默认值和取值范围?
Co-authored-by: xixirangrang <[email protected]>
@Oreoxmt: The following test failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
|
||
#### `table-concurrency` | ||
|
||
- 数据引擎的最大并行数。每张表被切分成一个用于存储索引的“索引引擎”和若干存储行数据的“数据引擎”。`index-concurrency` 和 `table-concurrency` 这两项设置控制两种引擎文件的最大并发数。通常情况下,你可以使用默认值。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 数据引擎的最大并行数。每张表被切分成一个用于存储索引的“索引引擎”和若干存储行数据的“数据引擎”。`index-concurrency` 和 `table-concurrency` 这两项设置控制两种引擎文件的最大并发数。通常情况下,你可以使用默认值。 | |
- 数据引擎的最大并行数。每张表被切分成一个用于存储索引的“索引引擎”和若干存储行数据的“数据引擎”。`index-concurrency` 和 `table-concurrency` 这两项设置控制两种引擎文件的最大并发数。通常情况下使用默认值。 |
|
||
#### `parallel-import` | ||
|
||
- 是否允许启动多个 TiDB Lightning 实例(物理导入模式)并行导入数据到一个或多个目标表。该参数仅限目标表为空的场景使用。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 是否允许启动多个 TiDB Lightning 实例(物理导入模式)并行导入数据到一个或多个目标表。该参数仅限目标表为空的场景使用。 | |
- 是否允许启动多个 TiDB Lightning 实例(物理导入模式)[并行导入数据](/tidb-lightning/tidb-lightning-distributed-import.md)到一个或多个目标表。该参数仅限目标表为空的场景使用。 |
- 该参数用于设置在完全并发下,“导入”和“写入”过程的持续时间比。该值可以通过计算 1 GiB 大小的单张表的(导入时长/写入时长)得到。你可以在日志文件中查看精确的时间。 | ||
- 如果“导入“更快,区块大小的差异就会更小。比值为 `0` 表示区块大小相同。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 该参数用于设置在完全并发下,“导入”和“写入”过程的持续时间比。该值可以通过计算 1 GiB 大小的单张表的(导入时长/写入时长)得到。你可以在日志文件中查看精确的时间。 | |
- 如果“导入“更快,区块大小的差异就会更小。比值为 `0` 表示区块大小相同。 | |
- 该参数用于设置在完全并发下,导入和写入过程的持续时间比。该值可以通过计算 1 GiB 大小的单张表的(导入时长/写入时长)得到。你可以在日志文件中查看精确的时间。 | |
- 如果导入更快,区块大小的差异就会更小。比值为 `0` 表示区块大小相同。 |
<!-- 示例值:`67_108_864` --> | ||
|
||
#### `tls` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `"required"`:在导入完成后执行 CHECKSUM 检查,如果 CHECKSUM 检查失败,则会报错退出 | ||
- `"optional"`:在导入完成后执行 CHECKSUM 检查,如果报错,会输出一条 WARN 日志并忽略错误 | ||
- `"off"`:导入结束后不执行 CHECKSUM 检查 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `"required"`:在导入完成后执行 CHECKSUM 检查,如果 CHECKSUM 检查失败,则会报错退出 | |
- `"optional"`:在导入完成后执行 CHECKSUM 检查,如果报错,会输出一条 WARN 日志并忽略错误 | |
- `"off"`:导入结束后不执行 CHECKSUM 检查 | |
- `"required"`:在导入完成后执行 Checksum 检查,如果 Checksum 检查失败,则会报错退出 | |
- `"optional"`:在导入完成后执行 Checksum 检查,如果报错,会输出一条 WARN 日志并忽略错误 | |
- `"off"`:导入结束后不执行 Checksum 检查 |
- 可选值: | ||
- `"false"`:表示通过 TiDB Lightning 下发 `ADMIN CHECKSUM TABLE <table>` 命令给 TiKV 执行。 | ||
- `"true"`:当该值为 `"true"` 时,如果要调整并发,需要在 TiDB 中设置 [`tidb_checksum_table_concurrency`](/system-variables.md#tidb_checksum_table_concurrency) 系统变量。 | ||
- 建议将该值设为 `"true"`,以便在执行 CHECKSUM 失败时更容易定位问题。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 建议将该值设为 `"true"`,以便在执行 CHECKSUM 失败时更容易定位问题。 | |
- 建议将该值设为 `"true"`,以便在执行 Checksum 失败时更容易定位问题。 |
|
||
#### `analyze` | ||
|
||
- 配置是否在 CHECKSUM 结束后对所有表逐个执行 `ANALYZE TABLE <table>` 操作。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 配置是否在 CHECKSUM 结束后对所有表逐个执行 `ANALYZE TABLE <table>` 操作。 | |
- 配置是否在 Checksum 结束后对所有表逐个执行 `ANALYZE TABLE <table>` 操作。 |
What is changed, added or deleted? (Required)
lightning: reformat TiDB Lightning config
ref: pingcap/docs#19523
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).
What is the related PR or file link(s)?
Do your changes match any of the following descriptions?