View a markdown version of this page

ALTER DBCLUSTERGROUP CANCEL JOB - Amazon Aurora

ALTER DBCLUSTERGROUP CANCEL JOB

Cancels a data movement job in a database cluster group for Aurora before its cutover.

Description

A canceled job leaves the collocation on its source member cluster, and the collocation's data mappings still name the source. The job drops exactly the objects that it created on the target, in reverse dependency order, and leaves the objects on the source untouched. A job that fails before its cutover cleans up the target in the same way.

Syntax

The syntax is as follows.

ALTER DBCLUSTERGROUP CANCEL JOB 'job_id';

Parameters and options

The statement takes the following parameter.

job_id

The job ID from the result of ALTER DBCLUSTERGROUP MOVE COLLOCATION or from move_info, as a string literal in single quotes.

Where it runs and required privileges

Run the statement at the routing endpoint, outside a transaction, in a session that isn't pinned. Inside a transaction, the statement returns error 1179. The router user needs dbclustergroup_move_admin or dbclustergroup_super_admin. For the privileges for database cluster groups for Aurora, see Privileges.

Usage notes

Keep the following in mind when you use the statement.

  • Confirm that the job hasn't begun its cutover, and then cancel it. To confirm the job's terminal state, read its row in Reading move status.

  • The routing layer refuses a cancel while the cutover is in progress. After the cutover, the job has nothing to cancel.

A canceled job reads Cancelled in the status column of move_info. Cleanup runs after a job is canceled, which you can see in the cleanup_status column of move_info. You can change the data mappings of the collocation or run another data movement job on the collocation after the cleanup completes.

Examples

The following example cancels a running job.

ALTER DBCLUSTERGROUP CANCEL JOB '4a6f1c2e-7d3b-4c1a-9e2f-5b8d0c6a1f30';

Errors

The statement can return the following errors. For all data movement errors, see Data movement errors.

Code (SQLSTATE) Message Meaning
1227 (42000) Access denied; you need the 'DBCLUSTERGROUP_MOVE_ADMIN' privilege for this operation Your router user lacks the dbclustergroup_move_admin privilege.
1179 (25000) You are not allowed to execute this command in a transaction The statement ran inside a transaction. Run it outside a transaction.
1221 (HY000) Cannot cancel a job that has reached the cutover phase The job is in CutoverInit or CutoverFlip, or past it. You can't cancel it.
1221 (HY000) Cannot cancel a job in the state state The job has ended. state is one of COMPLETED, ERROR or CANCELLED.
1525 (HY000) Incorrect job ID value: 'value' The job ID isn't a valid ID.
1305 (42000) MOVE JOB 'job_id' does not exist This job ID does not exist in this database cluster group for Aurora.

For more information, see the following: