Purpose
You can use this statement to modify the paxos_replica_num parameter for a log stream, which defines the number of Paxos members for electing the leader for the log stream.
Limitations and considerations
This statement modifies the
paxos_replica_numparameter for a single log stream at a time.One log stream of a tenant supports only one replica task at a time, such as a task to add replicas, remove replicas, convert the type of a replica, modify
paxos_replica_num, or migrate replicas.Note
You can query ongoing replica tasks from the
CDB_OB_LS_REPLICA_TASKSview in the `sys` tenant or from theDBA_OB_LS_REPLICA_TASKSview in a user tenant.
Required privileges
To execute this statement, you must have the ALTER SYSTEM privilege. For more information about privileges in OceanBase Database, see Privilege types in MySQL mode and Privilege types in Oracle mode.
Syntax
ALTER SYSTEM MODIFY
LS [=] ls_id
PAXOS_REPLICA_NUM [=] paxos_replica_num
[TENANT [=] 'tenant_name'];
Parameters
| Parameter | Description |
|---|---|
| ls_id | The ID of the target log stream. |
| paxos_replica_num | The new number of Paxos members for electing the leader for the log stream.
NoticeWhen you specify the
|
| tenant_name | Optional. The name of the target tenant. If this parameter is not specified, the name of the current tenant is used.
NoticeYou can specify another tenant in the |
Examples
Execute the following statement in the sys tenant to change the value of the paxos_replica_num parameter to 2 for the log stream with the ID of 1002 in the mysql001 tenant.
ALTER SYSTEM MODIFY
LS = 1002
PAXOS_REPLICA_NUM = 2
TENANT = 'mysql001';
For more information about how to modify the paxos_replica_num parameter for a log stream, see Modify the number of Paxos replicas of a log stream.
References
- For information about how to add a replica, see ADD REPLICA.
- For information about how to drop a replica, see REMOVE REPLICA.
- For information about how to modify the type of a replica, see MODIFY REPLICA.
- For information about how to migrate a replica, see MIGRATE REPLICA.
- For information about how to cancel a replica task, see CANCEL REPLICA TASK.