-
Notifications
You must be signed in to change notification settings - Fork 1.2k
BR: Add a new doc about creating table in batch #8659
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
Conversation
Co-authored-by: glorv <glorvs@163.com>
Co-authored-by: Grace Cai <qqzczy@126.com>
Conflicts: tidb-lightning/tidb-lightning-configuration.md
en-jin19
left a comment
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.
LGTM
|
LGTM |
Co-authored-by: Enwei <jinenwei@pingcap.com>
|
/merge |
|
@en-jin19: DetailsIn 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 ti-community-infra/tichi repository. |
|
/remove-status LGT1 |
|
/merge |
|
This pull request has been accepted and is ready to merge. DetailsCommit hash: a26eb3e |
|
|
||
| 使用 Backup & Restore (BR) 执行数据恢复任务时,BR 会先在下游 TiDB 集群创建库和表,再进行数据恢复。TiDB v6.0 之前,在数据恢复阶段创建表时,BR 采用了[串行执行](#实现原理)的方案。然而,当需要恢复的数据中带有大量的表(约 50000 张)时,该方案会在创建表上消耗较多时间。 | ||
|
|
||
| 为了通过加快创建表的速度和减少数据恢复的时间,从 TiDB v6.0 起,BR 引入了批量建表功能,此功能默认开启。 |
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 在 v6.0.0 中引入了 BR 】批量建表功能,此功能默认开启。
|
|
||
| # BR 批量建表 | ||
|
|
||
| 使用 Backup & Restore (BR) 执行数据恢复任务时,BR 会先在下游 TiDB 集群创建库和表,再进行数据恢复。TiDB v6.0 之前,在数据恢复阶段创建表时,BR 采用了[串行执行](#实现原理)的方案。然而,当需要恢复的数据中带有大量的表(约 50000 张)时,该方案会在创建表上消耗较多时间。 |
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.
为了与第 39 行保持一致,第一句可修改为以下内容(确定所有修改内容后,会提 PR 进行修改):
使用 Backup & Restore (BR) 执行数据恢复任务时,BR 会先在【目标 TiDB 集群上】创建库和表,再进行数据恢复。
|
|
||
| ## 实现原理 | ||
|
|
||
| - v6.0 前的串行建表方案:在 v6.0 之前的版本,BR 采用了串行建表方案。在使用 BR 执行数据恢复任务时,BR 会先在目标 TiDB 创建库和表后,再开始进行数据恢复。建表时,BR 会在调用 TiDB 接口后,使用 SQL 语句 `Create Table` 创建表。建表任务由 TiDB DDL owner 依次串行执行。在每张表被创建时,各会引起一次 schema 版本的变更,而每次的 schema 版本的变更都需要同步到其他 BR 和其他 TiDB DDL worker。因此,当需要创建的表的数量比较多时,串行建表方案会导致建表时间过长。 |
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.
- v6.0 前的串行建表方案:在 v6.0 之前的版本,BR 采用了串行建表方案。在使用 BR 执行数据恢复任务时,BR 会先在目标 TiDB 集群创建库和表后,再开始进行数据恢复。建表时,BR 会在调用 TiDB 内部接口后,使用 SQL 语句
Create Table创建表。建表任务由 TiDB DDL owner 依次串行执行。在每张表被创建时,各会引起一次 DDL schema 版本的变更,而每次的 schema 版本的变更都需要同步到其他 TiDB DDL worker(含 BR)。因此,当需要创建的表的数量比较多时,串行建表方案会导致建表时间过长。
| ## 实现原理 | ||
|
|
||
| - v6.0 前的串行建表方案:在 v6.0 之前的版本,BR 采用了串行建表方案。在使用 BR 执行数据恢复任务时,BR 会先在目标 TiDB 创建库和表后,再开始进行数据恢复。建表时,BR 会在调用 TiDB 接口后,使用 SQL 语句 `Create Table` 创建表。建表任务由 TiDB DDL owner 依次串行执行。在每张表被创建时,各会引起一次 schema 版本的变更,而每次的 schema 版本的变更都需要同步到其他 BR 和其他 TiDB DDL worker。因此,当需要创建的表的数量比较多时,串行建表方案会导致建表时间过长。 | ||
| - v6.0 起的批量建表方案:批量建表功能采用了并发批量建表方案。从 v6.0 起,在默认情况下,BR 会以 128 张表为一批,并发创建多批表。采用该方案后,BR 每建一批表时,TiDB schema 版本只会变更一次。此方法极大地提高了建表速度。 |
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.
- v6.0 起的批量建表方案:从 v6.0 起,在默认情况下,BR 会以 128 张表为一批,并发创建多批表。采用该方案后,BR 每建一批表时,TiDB schema 版本只会变更一次。此方法极大地提高了建表速度。
First-time contributors' checklist
What is changed, added or deleted? (Required)
Added a new document for introducing new features in BR. (br/br-freatures.md)
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?