Purpose
This statement is used to modify the paxos_replica_num of a log stream, which specifies the number of required members for the leader of the log stream.
Limitations and considerations
This statement can only modify the
paxos_replica_numof one log stream at a time.For the same log stream in a tenant, only one disaster recovery task (excluding replica migration tasks) can be executed at a time. This includes tasks such as adding a replica, deleting a replica, changing the replica type, and modifying the number of required members for the leader of the log stream.
Note
The sys tenant can check the
CDB_OB_LS_REPLICA_TASKSview to confirm if there are any ongoing disaster recovery tasks. User tenants can check theDBA_OB_LS_REPLICA_TASKSview for the same information.
Privilege requirements
The user executing this statement must have the ALTER SYSTEM privilege. For more information about OceanBase Database privileges, see Privilege classification in MySQL mode and Privilege classification in Oracle mode.
Syntax
ALTER SYSTEM MODIFY
LS [=] ls_id
PAXOS_REPLICA_NUM [=] paxos_replica_num
[TENANT [=] 'tenant_name'];
Parameters
| Parameter | Description |
|---|---|
| ls_id | Specifies the ID of the log stream to be modified. |
| paxos_replica_num | Specifies the new number of required members for the leader.
NoticeWhen specifying the value of this parameter, please note the following:
|
| tenant_name | Optional. Specifies the tenant to operate on. If not explicitly specified, the current tenant is used as the default.
NoticeThe sys tenant can specify other tenants, while user tenants can only specify their own tenant. This statement does not support using |
Examples
Execute the following command in the sys tenant to change the PAXOS_REPLICA_NUM of the log stream (1002) in the mysql001 tenant to 2.
ALTER SYSTEM MODIFY
LS = 1002
PAXOS_REPLICA_NUM = 2
TENANT = 'mysql001';
For more examples on modifying the paxos_replica_num of a log stream, see Modify the number of required members for the leader of a log stream.
References
- For information about manually adding a log stream replica, see ADD REPLICA.
- For information about deleting a log stream replica, see REMOVE REPLICA.
- For information about changing the type of a log stream replica, see MODIFY REPLICA.
- For information about migrating a log stream replica, see MIGRATE REPLICA.
- For information about canceling a log stream replica task, see CANCEL REPLICA TASK.
