Purpose
This statement is used to manually cancel a running replica task.
Limitations and considerations
- The current version only supports canceling two types of replica tasks: adding replicas and migrating replicas. You can view which disaster recovery tasks are currently in progress through the
DBA_OB_LS_REPLICA_TASKSview. - This statement can only cancel one disaster recovery task for a tenant at a time.
- The cancel command is idempotent. Executing it multiple times has the same effect as executing it once.
- You must ensure that the task to be canceled is still running. If the task has already completed, it cannot be canceled.
- A successful return from the cancel command only indicates that the RS has sent the cancellation RPC to the underlying layer. The underlying layer may not guarantee a successful cancellation, as replica task execution is divided into multiple stages. If a task has reached its final stage, it cannot be canceled. The result of a task cancellation can be checked through the
TASK_STATUSfield in theDBA_OB_LS_REPLICA_TASK_HISTORYview. If it isCANCELED, the cancellation was successful.
Privilege requirements
The user executing this statement must have the ALTER SYSTEM privilege. For more information about OceanBase AI Database privileges, see Permission classification.
Syntax
ALTER SYSTEM CANCEL REPLICA TASK
TASK_ID [=] task_id
[TENANT [=] '$tenant_name'];
Parameters
Parameters |
Description |
|---|---|
| task_id | Specify the task ID of the replica task to be canceled. TASK_ID. |
| tenant_name | Optional. Specifies the tenant to operate on. If you do not explicitly specify the tenant, the default tenant is the current tenant.
NoticeThe system tenant can specify other tenants, while a user tenant can only specify itself. This statement does not support using |
Examples
Execute the following command in the sys tenant to cancel the ongoing replica task in tenant mysql001.
ALTER SYSTEM CANCEL REPLICA TASK
TASK_ID = 'Y13CE64586BD4-000610C5F3EDBBCB-0-0'
TENANT = 'mysql001';
For more examples of canceling a running replica task, see Cancel a replica task.
References
- For information about manually adding log stream replicas, see ADD REPLICA.
- For information about deleting log stream replicas, see REMOVE REPLICA.
- For information about converting log stream replica types, see MODIFY REPLICA.
- For information about migrating log stream replicas, see MIGRATE REPLICA.
- For information about modifying the log stream
PAXOS_REPLICA_NUM, see MODIFY PAXOS_REPLICA_NUM.