Skip to content

Commit

Permalink
lightning: update config description of checksum and analyze (#7408) (#…
Browse files Browse the repository at this point in the history
…7796)

* This is an automated cherry-pick of #7408

Signed-off-by: ti-chi-bot <[email protected]>

* resolve conflicts

Co-authored-by: glorv <[email protected]>
  • Loading branch information
ti-chi-bot and glorv authored Dec 6, 2021
1 parent b9ee8ad commit 5d26f0e
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions tidb-lightning/tidb-lightning-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ addr = "172.16.31.10:8287"

[mydumper]
# 设置文件读取的区块大小,确保该值比数据源的最长字符串长。
read-block-size = 65536 # Byte (默认为 64 KB)
read-block-size = "64KiB" # 默认值

# (源数据文件)单个导入区块大小的最小值。
# TiDB Lightning 根据该值将一张大表分割为多个数据引擎文件。
Expand All @@ -122,7 +122,7 @@ read-block-size = 65536 # Byte (默认为 64 KB)
# 引擎文件需按顺序导入。由于并行处理,多个数据引擎几乎在同时被导入,
# 这样形成的处理队列会造成资源浪费。因此,为了合理分配资源,TiDB Lightning
# 稍微增大了前几个区块的大小。该参数也决定了比例系数,即在完全并发下
# “导入”和“写入”过程的持续时间比。这个值可以通过计算 1 GB 大小的
# “导入”和“写入”过程的持续时间比。这个值可以通过计算 1 GiB 大小的
# 单张表的(导入时长/写入时长)得到。在日志文件中可以看到精确的时间。
# 如果“导入”更快,区块大小的差异就会更小;比值为 0 时则说明区块大小一致。
# 取值范围为(0 <= batch-import-ratio < 1)。
Expand Down Expand Up @@ -151,7 +151,7 @@ character-set = "auto"
strict-format = false

# 如果 strict-format = true,TiDB Lightning 会将 CSV 大文件分割为多个文件块进行并行处理。max-region-size 是分割后每个文件块的最大大小。
# max-region-size = 268_435_456 # Byte(默认是 256 MB)
# max-region-size = "256MiB" # 默认值

# 只导入与该通配符规则相匹配的表。详情见相应章节。
filter = ['*.*']
Expand Down Expand Up @@ -225,17 +225,23 @@ max-allowed-packet = 67_108_864
# 在生产环境中,建议这将些参数都设为 true。
# 执行的顺序为:Checksum -> Compact -> Analyze。
[post-restore]
# 如果设置为 true,会对所有表逐个执行 `ADMIN CHECKSUM TABLE <table>` 操作
# 来验证数据的完整性。
checksum = true
# 配置是否在导入完成后对每一个表执行 `ADMIN CHECKSUM TABLE <table>` 操作来验证数据的完整性。
# 可选的配置项:
# - "required"(默认)。在导入完成后执行 CHECKSUM 检查,如果 CHECKSUM 检查失败,则会报错退出。
# - "optional"。在导入完成后执行 CHECKSUM 检查,如果报错,会输出一条 WARN 日志并忽略错误。
# - "off"。导入结束后不执行 CHECKSUM 检查。
# 默认值为 "required"。从 v4.0.8 开始,checksum 的默认值由此前的 "true" 改为 "required"。
# 注意:考虑到与旧版本的兼容性,依然可以在本配置项设置 `true` 和 `false` 两个布尔值,其效果与 "required" 和 `off` 相同。
checksum = "required"
# 配置是否在 CHECKSUM 结束后对所有表逐个执行 `ANALYZE TABLE <table>` 操作。
# 此配置的可选配置项与 `post-restore` 相同,但默认值为 "optional"。
analyze = "optional"
# 如果设置为 true,会在导入每张表后执行一次 level-1 Compact。
# 默认值为 false。
level-1-compact = false
# 如果设置为 true,会在导入过程结束时对整个 TiKV 集群执行一次 full Compact。
# 默认值为 false。
compact = false
# 如果设置为 true,会对所有表逐个执行 `ANALYZE TABLE <table>` 操作。
analyze = true

# 设置周期性后台操作。
# 支持的单位:h(时)、m(分)、s(秒)。
Expand Down Expand Up @@ -350,8 +356,8 @@ min-available-ratio = 0.05
| --tidb-password *password* | 连接到 TiDB 的密码 | `tidb.password` |
| --no-schema | 忽略表结构文件,直接从 TiDB 中获取表结构信息 | `mydumper.no-schema` |
| --enable-checkpoint *bool* | 是否启用断点 (默认值为 true) | `checkpoint.enable` |
| --analyze *bool* | 导入后分析表信息 (默认值为 true) | `post-restore.analyze` |
| --checksum *bool* | 导入后比较校验和 (默认值为 true) | `post-restore.checksum` |
| --analyze *level* | 导入后分析表信息,可选值为 required、optional(默认值)、off | `post-restore.analyze` |
| --checksum *level* | 导入后比较校验和,可选值为 required(默认值)、optional、off | `post-restore.checksum` |
| --check-requirements *bool* | 开始之前检查集群版本兼容性(默认值为 true)| `lightning.check-requirements` |
| --ca *file* | TLS 连接的 CA 证书路径 | `security.ca-path` |
| --cert *file* | TLS 连接的证书路径 | `security.cert-path` |
Expand Down

0 comments on commit 5d26f0e

Please sign in to comment.