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

Add description on admin pause ddl jobs and admin resume ddl jobs #13897

Merged
merged 11 commits into from
Jun 26, 2023

Conversation

ran-huang
Copy link
Contributor

First-time contributors' checklist

What is changed, added or deleted? (Required)

Add description about the new admin command:

  • admin pause ddl jobs
  • admin resume ddl jobs

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)
  • v7.1 (TiDB 7.1 versions)
  • v7.0 (TiDB 7.0 versions)
  • v6.6 (TiDB 6.6 versions)
  • v6.5 (TiDB 6.5 versions)
  • v6.1 (TiDB 6.1 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)

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

Related issue number:

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

@ran-huang ran-huang added translation/from-docs-cn This PR is translated from a PR in pingcap/docs-cn. v7.2 labels Jun 15, 2023
@ti-chi-bot ti-chi-bot bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 15, 2023
Signed-off-by: Ran <huangran.alex@gmail.com>
@ran-huang ran-huang self-assigned this Jun 15, 2023
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 15, 2023
@ran-huang ran-huang requested a review from hfxsd June 19, 2023 03:19
error-codes.md Outdated Show resolved Hide resolved
summary: An overview of the usage of ADMIN PAUSE DDL for the TiDB database.
---

# ADMIN PAUSE DDL
Copy link
Collaborator

@hfxsd hfxsd Jun 20, 2023

Choose a reason for hiding this comment

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

需要统一成 ADMIN PAUSE DDL JOBS 吗?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

ran-huang and others added 3 commits June 21, 2023 13:26
Co-authored-by: xixirangrang <hfxsd@hotmail.com>
Co-authored-by: xixirangrang <hfxsd@hotmail.com>
Co-authored-by: xixirangrang <hfxsd@hotmail.com>
@@ -178,6 +178,14 @@ When TiDB is adding an index, the phase of backfilling data will cause read and

If a completed DDL task is canceled, you can see the `DDL Job:90 not found` error in the `RESULT` column, which means that the task has been removed from the DDL waiting queue.

- `ADMIN PAUSE DDL JOBS job_id [, job_id]`: Used to pause the DDL tasks that are being executed. After the command is executed, the SQL statement that executes the DDL task is displayed as being executed, and the background task is paused. For details, refer to [`ADMIN PAUSE DDL JOBS`](/sql-statements/sql-statement-admin-pause-ddl.md). (Experimental feature)
Copy link

Choose a reason for hiding this comment

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

tasks ----> jobs

We'd better keep the concept identical.

Copy link

Choose a reason for hiding this comment

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

"After the command is executed"
---->
"After the command was executed"

假设语句要用虚拟语气

Copy link

Choose a reason for hiding this comment

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

"displayed as being executed, and the background task is pause"

---->

"displayed as executing, while the background job has been paused"

Copy link

Choose a reason for hiding this comment

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

"Used to pause the DDL tasks that are being executed."

---->

"Used to pause the DDL tasks that are being executing." 感觉这样要更好些


`ADMIN PAUSE DDL` allows you to pause a running DDL job. The `job_id` can be found by running [`ADMIN SHOW DDL JOBS`](/sql-statements/sql-statement-admin-show-ddl.md).

You can use this statement to pause a DDL job that is committed but not yet completed executing. After the pause, the SQL statement that executes the DDL job does not return immediately, but looks like it is still running. If you try to pause a DDL job that has already been completed, you will see the `DDL Job:90 not found` error in the `RESULT` column, which indicates that the job has been removed from the DDL waiting queue.
Copy link

Choose a reason for hiding this comment

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

"committed" seems not correct.

Copy link

Choose a reason for hiding this comment

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

中文原文中的“已提交”是指已提到后端的意思,刚刚已改为“已发起”

Copy link

Choose a reason for hiding this comment

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

"If you try to pause a DDL job that has already been completed, you will see the DDL Job:90 not found error in the RESULT column, which indicates that the job has been removed from the DDL waiting queue."

这里用上了虚拟语气,可能需要保持一致


`ADMIN RESUME DDL` allows you to resume a paused DDL job. You can find the `job_id` by running [`ADMIN SHOW DDL JOBS`](/sql-statements/sql-statement-admin-show-ddl.md).

You can use this statement to resume a paused DDL job. After the resume is complete, the SQL statement that executes the DDL job continues to show as being executed. If you try to resume a DDL job that has already been completed, you will see the `DDL Job:90 not found` error in the `RESULT` column, which indicates that the job has been removed from the DDL waiting queue.
Copy link

Choose a reason for hiding this comment

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

complete ----> completed

@@ -178,6 +178,14 @@ When TiDB is adding an index, the phase of backfilling data will cause read and

If a completed DDL task is canceled, you can see the `DDL Job:90 not found` error in the `RESULT` column, which means that the task has been removed from the DDL waiting queue.

- `ADMIN PAUSE DDL JOBS job_id [, job_id]`: Used to pause the DDL tasks that are being executed. After the command is executed, the SQL statement that executes the DDL task is displayed as being executed, and the background task is paused. For details, refer to [`ADMIN PAUSE DDL JOBS`](/sql-statements/sql-statement-admin-pause-ddl.md). (Experimental feature)

You can pause only DDL tasks that are in progress or still in the queue. Otherwise, the `Job 3 can't be paused now` error is shown in the `RESULT` column.
Copy link

Choose a reason for hiding this comment

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

"only" 感觉放在 "pause" 前面更好些

@dhysum
Copy link

dhysum commented Jun 25, 2023

lgtm

sql-statements/sql-statement-admin-pause-ddl.md Outdated Show resolved Hide resolved
ddl-introduction.md Outdated Show resolved Hide resolved
sql-statements/sql-statement-admin-resume-ddl.md Outdated Show resolved Hide resolved
ddl-introduction.md Outdated Show resolved Hide resolved
@ran-huang ran-huang requested a review from hfxsd June 26, 2023 02:15
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jun 26, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Jun 26, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-06-26 02:29:04.822910579 +0000 UTC m=+588310.224161026: ☑️ agreed by hfxsd.

@ti-chi-bot ti-chi-bot bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 26, 2023
@ti-chi-bot ti-chi-bot bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 26, 2023
@ran-huang ran-huang added the lgtm label Jun 26, 2023
@ran-huang
Copy link
Contributor Author

/approve

@ti-chi-bot
Copy link

ti-chi-bot bot commented Jun 26, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ran-huang

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

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the approved label Jun 26, 2023
add custom content 2

Signed-off-by: Ran <huangran.alex@gmail.com>
@ran-huang ran-huang force-pushed the dev/admin_pause_resume-14199 branch from 297b918 to 1a58d86 Compare June 26, 2023 08:24
@ti-chi-bot ti-chi-bot bot merged commit 6fa9a4c into pingcap:master Jun 26, 2023
@ran-huang ran-huang deleted the dev/admin_pause_resume-14199 branch June 26, 2023 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-1-more-lgtm Indicates a PR needs 1 more LGTM. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. translation/from-docs-cn This PR is translated from a PR in pingcap/docs-cn. v7.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants