title | summary |
---|---|
ADMIN PAUSE DDL JOBS |
An overview of the usage of ADMIN PAUSE DDL JOBS for the TiDB database. |
ADMIN PAUSE DDL
allows you to pause a running DDL job. The job_id
can be found by running ADMIN SHOW DDL JOBS
.
You can use this statement to pause a DDL job that is issued 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.
AdminPauseDDLStmt ::=
'ADMIN' 'PAUSE' 'DDL' 'JOBS' NumList
NumList ::=
Int64Num ( ',' Int64Num )*
ADMIN PAUSE DDL JOBS
pauses the currently running DDL job and returns whether the job is paused successfully. The job can be resumed by ADMIN RESUME DDL JOBS
.
ADMIN PAUSE DDL JOBS job_id [, job_id] ...;
If the pause fails, the specific reason for the failure is displayed.
Note:
- This statement can pause a DDL job, but other operations and environment changes (such as machine restarts and cluster restarts) do not pause DDL jobs except for cluster upgrades.
- During the cluster upgrade, the ongoing DDL jobs are paused, and the DDL jobs initiated during the upgrade are also paused. After the upgrade, all paused DDL jobs will resume. The pause and resume operations during the upgrade are taken automatically. For details, see TiDB Smooth Upgrade.
- This statement can pause multiple DDL jobs. You can use the
ADMIN SHOW DDL JOBS
statement to obtain thejob_id
of a DDL job.
Note:
- This statement can pause a DDL job, but other operations and environment changes (such as machine restarts and cluster restarts) do not pause DDL jobs except for cluster upgrades.
- During the cluster upgrade, the ongoing DDL jobs are paused, and the DDL jobs initiated during the upgrade are also paused. After the upgrade, all paused DDL jobs will resume. The pause and resume operations during the upgrade are taken automatically. For details, see TiDB Smooth Upgrade.
- This statement can pause multiple DDL jobs. You can use the
ADMIN SHOW DDL JOBS
statement to obtain thejob_id
of a DDL job.
This statement is a TiDB extension to MySQL syntax.