Note
This parameter was introduced in OceanBase Database V4.2.1.
Description
enable_transfer specifies whether to allow transfer within a tenant. This parameter is invalid when enable_rebalance is set to False.
Attributes
| Attribute | Description |
|---|---|
| Type | Boolean |
| Default value | True |
| Value range |
|
| Modifiable | Yes. You can use the ALTER SYSTEM SET statement to modify the parameter. |
| Effective upon OBServer node restart | No |
Considerations
The load balancing strategy for a tenant is jointly controlled by the tenant-level parameters enable_rebalance and enable_transfer.
You can specify the enable_rebalance parameter in the sys tenant to control whether to enable load balancing among tenants, and specify this parameter in a user tenant to control whether to enable load balancing for the current tenant. The default value is true. The setting takes effect immediately without the need to restart the OBServer node.
You can specify the enable_transfer parameter to control whether to enable the transfer feature for a tenant. The default value is true. The setting takes effect immediately without the need to restart the OBServer node. The enable_transfer parameter depends on the value of the enable_rebalance parameter.
If the value of
enable_rebalanceisfalse, the system does not perform automatic load balancing regardless of whether the value ofenable_transferistrueorfalse. The command to disable load balancing is as follows:obclient> ALTER SYSTEM SET enable_rebalance=false;If the value of
enable_rebalanceistrueand the value ofenable_transferistrue, the system automatically adjusts partition distribution to achieve load balancing during a tenant scaling operation. You can dynamically adjust the number of log streams for a tenant based on the load balancing algorithm and enable automatic leader balancing and partition balancing in the tenant as follows:obclient> ALTER SYSTEM SET enable_rebalance=true; obclient> ALTER SYSTEM SET enable_transfer=true;If the value of
enable_rebalanceistrueand the value ofenable_transferisfalse, the system cannot initiate transfer operations during tenant scaling, but can implement limited load balancing through log stream migration. You can balance existing log streams without transfer or dynamic changes in the number of log streams as follows:obclient> ALTER SYSTEM SET enable_rebalance=true; obclient> ALTER SYSTEM SET enable_transfer=false;
Examples
Enable load balancing for a specified tenant from the
systenantEnable load balancing and the transfer feature for a specified tenant from the
systenantobclient> ALTER SYSTEM SET enable_rebalance = true TENANT = 'tenant_name';obclient> ALTER SYSTEM SET enable_transfer = true TENANT = 'tenant_name';These statements only set the values of the
enable_rebalanceandenable_transferparameters totruefor the specified user tenant.Enable intra-tenant load balancing and the transfer feature for all user tenants from the
systenantobclient> ALTER SYSTEM SET enable_rebalance = true TENANT = all_user;obclient> ALTER SYSTEM SET enable_transfer = true TENANT = all_user;or
obclient> ALTER SYSTEM SET enable_rebalance = true TENANT = all;obclient> ALTER SYSTEM SET enable_transfer = true TENANT = all;These statements only set the values of the
enable_rebalanceandenable_transferparameters totruefor all user tenants.Note
In OceanBase Database V4.2.1 and later,
TENANT = all_userandTENANT = allexpress the same semantics. If you want an operation to take effect on all user tenants, we recommend that you useTENANT = all_user.TENANT = allwill be deprecated.
Enable load balancing for a user tenant from the current tenant
MySQL modeOracle modeYou can execute the following statements to enable load balancing and the transfer feature for a MySQL tenant:
obclient> ALTER SYSTEM SET enable_rebalance = true;obclient> ALTER SYSTEM SET enable_transfer = true;You can execute the following statements to enable load balancing and the transfer feature for an Oracle tenant:
obclient> ALTER SYSTEM SET enable_rebalance = 'true';obclient> ALTER SYSTEM SET enable_transfer = 'true';