title | summary |
---|---|
Pause a Data Migration Task |
Learn how to pause a data migration task in TiDB Data Migration. |
You can use the pause-task
command to pause a data migration task.
pause-task
differs from stop-task
in that:
pause-task
only pauses a migration task. You can query the status information (retained in the memory) of the task usingquery-status
.stop-task
terminates a migration task and removes all information related to this task from the memory. This means you cannot usequery-status
to query the status information.dm_meta
like "checkpoint" and data that have been migrated to the downstream are not removed.- If
pause-task
is executed to pause the migration task, you cannot start a new task with the same name, neither can you get the relay log of the paused task removed, since this task does exist. Ifstop-task
is executed to stop a task, you can start a new task with the same name, and you can get the relay log of the stopped task removed, since this task no longer exists. pause-task
is usually used to pause a task for troubleshooting, whilestop-task
is to permanently remove a migration task, or to co-work withstart-task
to update the configuration information.
{{< copyable "" >}}
help pause-task
pause a specified running task
Usage:
dmctl pause-task [-s source ...] <task-name | task-file> [flags]
Flags:
-h, --help help for pause-task
Global Flags:
-s, --source strings MySQL Source ID
{{< copyable "" >}}
pause-task [-s "mysql-replica-01"] task-name
-s
: (Optional) Specifies the MySQL source where you want to pause the subtasks of the migration task. If it is set, this command pauses only the subtasks on the specified MySQL source.task-name| task-file
: (Required) Specifies the task name or task file path.
{{< copyable "" >}}
pause-task test
{
"op": "Pause",
"result": true,
"msg": "",
"sources": [
{
"result": true,
"msg": "",
"source": "mysql-replica-01",
"worker": "worker1"
}
]
}