You can cancel an ongoing tenant cloning job. After the tenant cloning job is canceled, the job status changes to CANCELED, and the system automatically releases the resources allocated to the job.
Considerations
If the new tenant has been created and switched to the normal service state before you cancel the tenant cloning job, an error will be returned when you execute the cancellation statement.
Procedure
Log on to the
systenant of the cluster as therootuser.obclient -h172.30.xx.xx -P2883 -uroot@sys#cluster -p**** -AExecute the following statement to cancel an ongoing tenant cloning job:
ALTER SYSTEM CANCEL CLONE new_tenant_name;Here,
new_tenant_namespecifies the name of the new tenant.After the statement is executed, you can query the cloning job history from a view.
obclient [oceanbase]> SELECT * FROM oceanbase.DBA_OB_CLONE_HISTORY\GThe query result is as follows:
*************************** 1. row *************************** CLONE_JOB_ID: 1702212525544202404 TRACE_ID: YA4740B7C050F-00060C210F4A4859-0-0 SOURCE_TENANT_ID: 1004 SOURCE_TENANT_NAME: mysql CLONE_TENANT_ID: 0 CLONE_TENANT_NAME: clone_tnt TENANT_SNAPSHOT_ID: 1702212525756306747 TENANT_SNAPSHOT_NAME: _inner_snapshot$1702212525656187169 RESOURCE_POOL_ID: 1009 RESOURCE_POOL_NAME: clone_tnt_pool UNIT_CONFIG_NAME: S1_unit_config RESTORE_SCN: 18446744073709551615 STATUS: CLONE_SYS_CANCELED CLONE_JOB_TYPE: FORK CLONE_START_TIME: 2023-12-10 20:48:45.544031 CLONE_FINISHED_TIME: 2023-12-10 20:48:51.070501 RET_CODE: -4072 ERROR_MESSAGE: clone job has been canceled 1 row in setThe query result shows that the job status has changed to
CLONE_SYS_CANCELED.