Skip to content
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

Update the doc of BR batch create table #8786

Merged

Conversation

en-jin19
Copy link
Contributor

@en-jin19 en-jin19 commented Mar 30, 2022

What is changed, added or deleted? (Required)

Update descriptions about the BR batch create table feature.

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)
  • v6.0 (TiDB 6.0 versions)
  • v5.4 (TiDB 5.4 versions)
  • v5.3 (TiDB 5.3 versions)
  • v5.2 (TiDB 5.2 versions)
  • v5.1 (TiDB 5.1 versions)
  • v5.0 (TiDB 5.0 versions)
  • v4.0 (TiDB 4.0 versions)
  • v3.1 (TiDB 3.1 versions)
  • v3.0 (TiDB 3.0 versions)
  • v2.1 (TiDB 2.1 versions)

What is the related PR or file 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

@en-jin19 en-jin19 added type/enhancement The issue or PR belongs to an enhancement. translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. v6.0 This PR/issue applies to TiDB v6.0. area/br Indicates that the Issue or PR belongs to the area of BR (Backup & Restore). labels Mar 30, 2022
@en-jin19 en-jin19 requested review from TomShawn and fengou1 March 30, 2022 03:39
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Mar 30, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • TomShawn

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@en-jin19 en-jin19 self-assigned this Mar 30, 2022
@ti-chi-bot ti-chi-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 30, 2022
- v6.0 起的批量建表方案:批量建表功能采用了并发批量建表方案。从 v6.0 起,在默认情况下,BR 会以 128 张表为一批,并发创建多批表。采用该方案后,BR 每建一批表时,TiDB schema 版本只会变更一次。此方法极大地提高了建表速度。
- v6.0.0 前的串行建表方案:

在使用 BR 执行数据恢复任务时,BR 会先在目标 TiDB 集群创建库和表后,再开始进行数据恢复。建表时,BR 会在调用 TiDB 内部接口后,使用 SQL 语句 `Create Table` 创建表。建表任务由 TiDB DDL owner 依次串行执行。在每张表被创建时,各会引起一次 DDL schema 版本的变更,而每次的 schema 版本的变更都需要同步到其他 TiDB DDL worker(含 BR)。因此,当需要创建的表的数量比较多时,串行建表方案会导致建表时间过长。
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
在使用 BR 执行数据恢复任务时,BR 会先在目标 TiDB 集群创建库和表后,再开始进行数据恢复。建表时,BR 会在调用 TiDB 内部接口后,使用 SQL 语句 `Create Table` 创建表。建表任务由 TiDB DDL owner 依次串行执行。在每张表被创建时,各会引起一次 DDL schema 版本的变更,而每次的 schema 版本的变更都需要同步到其他 TiDB DDL worker(含 BR)。因此,当需要创建的表的数量比较多时,串行建表方案会导致建表时间过长。
在使用 BR 执行数据恢复任务时,BR 会先在目标 TiDB 集群创建库和表后,再开始进行数据恢复。建表时,BR 会在调用 TiDB 内部接口后,类似使用 SQL 语句 `Create Table` 创建表。建表任务由 TiDB DDL owner 依次串行执行。在每张表被创建时,各会引起一次 DDL schema 版本的变更,而每次的 schema 版本的变更都需要同步到其他 TiDB DDL worker(含 BR)。因此,当需要创建的表的数量比较多时,串行建表方案会导致建表时间过长。

@ti-chi-bot ti-chi-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 1, 2022

使用 Backup & Restore (BR) 执行数据恢复任务时,BR 会先在下游 TiDB 集群创建库和表,再进行数据恢复。TiDB v6.0 之前,在数据恢复阶段创建表时,BR 采用了[串行执行](#实现原理)的方案。然而,当需要恢复的数据中带有大量的表(约 50000 张)时,该方案会在创建表上消耗较多时间。
使用 Backup & Restore (BR) 执行数据恢复任务时,BR 会先在目标 TiDB 集群上创建库和表,然后再进行数据恢复。TiDB v6.0.0 之前,在数据恢复阶段创建表时,BR 采用了[串行执行](#实现原理)的方案。然而,当需要恢复的数据中带有大量的表(约 50000 张)时,该方案会在创建表上消耗较多时间。
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
使用 Backup & Restore (BR) 执行数据恢复任务时,BR 会先在目标 TiDB 集群上创建库和表,然后再进行数据恢复。TiDB v6.0.0 之前,在数据恢复阶段创建表时,BR 采用了[串行执行](#实现原理)的方案。然而,当需要恢复的数据中带有大量的表(约 50000 张)时,该方案会在创建表上消耗较多时间。
使用 Backup & Restore (BR) 执行数据恢复任务时,BR 会先在目标 TiDB 集群上创建库和表,然后再把已备份的数据恢复到表中。TiDB v6.0.0 之前,在数据恢复阶段创建表时,BR 采用了[串行执行](#实现原理)的方案。然而,当需要恢复的数据中带有大量的表(约 50000 张)时,该方案会在创建表上消耗较多时间。

Copy link
Contributor

@TomShawn TomShawn left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Apr 1, 2022
@en-jin19
Copy link
Contributor Author

en-jin19 commented Apr 1, 2022

/remove-status LGT1
/status LGT2

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Apr 1, 2022
@en-jin19
Copy link
Contributor Author

en-jin19 commented Apr 1, 2022

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 082c0d3

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Apr 1, 2022
@ti-chi-bot ti-chi-bot merged commit c939570 into pingcap:master Apr 1, 2022
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #8822.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/br Indicates that the Issue or PR belongs to the area of BR (Backup & Restore). size/M Denotes a PR that changes 30-99 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. type/enhancement The issue or PR belongs to an enhancement. v6.0 This PR/issue applies to TiDB v6.0.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants