Description
This statement is used to modify the paxos_replica_num of a log stream, that is, to change the quorum size of the log stream's leader.
Limitations and considerations
This statement can modify the
paxos_replica_numof only one log stream at a time.For the same log stream of a tenant, except that multiple replica migration tasks can be executed in parallel, only one disaster recovery task (including adding replicas, deleting replicas, converting replica types, and modifying the quorum size of a log stream at a time is allowed.
Note
You can query the
CDB_OB_LS_REPLICA_TASKSview in the sys tenant or theDBA_OB_LS_REPLICA_TASKSview in a user tenant to check whether any disaster recovery tasks are running.
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 MODIFY
LS [=] ls_id
PAXOS_REPLICA_NUM [=] paxos_replica_num
[TENANT [=] 'tenant_name'];
Parameters
Parameters |
Description |
|---|---|
| ls_id | Specifies the ID of the log stream to be modified. |
| paxos_replica_num | Specifies the number of quorum members for the modified leader.
NoticeWhen specifying the value of this parameter, note the following:
|
| 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 change the PAXOS_REPLICA_NUM value for log stream (1002) in tenant mysql001 to 2.
ALTER SYSTEM MODIFY
LS = 1002
PAXOS_REPLICA_NUM = 2
TENANT = 'mysql001';
For more examples of modifying the log stream paxos_replica_num, see Modify the quorum size of a log stream.
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 canceling a log stream replica task, see CANCEL REPLICA TASK.