Note
This parameter is introduced in V4.2.1.
Description
The enable_transfer parameter specifies whether to allow data transfer within the tenant.
Attributes
| Attribute | Description |
|---|---|
| Parameter type | BOOL |
| Default value | True |
| Value range |
|
| Changeable | Yes. You can execute the ALTER SYSTEM SET statement to modify the parameter value. |
| Effective only after OBServer restart | No |
Usage notes
The tenant-level load balancing strategy is jointly controlled by the enable_rebalance and enable_transfer parameters.
The enable_rebalance parameter specifies whether to enable load balancing between tenants. The default value is true. This parameter takes effect immediately without the need to restart the OBServer node.
The enable_transfer parameter specifies whether to enable data transfer within a tenant. The default value is true. This parameter takes effect immediately without the need to restart the OBServer node. The value of the enable_transfer parameter depends on the value of the enable_rebalance parameter:
If the value of the
enable_rebalanceparameter isfalse, the system will not perform automatic load balancing regardless of whether the value of theenable_transferparameter istrueorfalse. The command to disable all load balancing is as follows:obclient> ALTER SYSTEM SET enable_rebalance=false;If the value of the
enable_rebalanceparameter istrueand the value of theenable_transferparameter istrue, the system will automatically adjust partition distribution during tenant scaling to achieve load balancing. The commands to dynamically adjust the number of log streams based on the load balancing algorithm, automatically perform leader and partition balancing are as follows:obclient> ALTER SYSTEM SET enable_rebalance=true; obclient> ALTER SYSTEM SET enable_transfer=true;If the value of the
enable_rebalanceparameter istrueand the value of theenable_transferparameter isfalse, the system will not initiate data transfer operations during tenant scaling. Instead, it can only achieve limited balancing by migrating log streams. The commands to balance log streams based on the existing log stream distribution without creating transfers or dynamically changing the number of log streams are as follows:obclient> ALTER SYSTEM SET enable_rebalance=true; obclient> ALTER SYSTEM SET enable_transfer=false;
Examples
Configure the load balancing strategy for a specified tenant in the sys tenant.
Enable the tenant-level load balancing and transfer features for the specified tenant.
obclient> ALTER SYSTEM SET enable_rebalance = true TENANT = 'tenant_name';obclient> ALTER SYSTEM SET enable_transfer = true TENANT = 'tenant_name';The preceding statements indicate that only the values of
enable_rebalanceandenable_transferfor the specified tenant are set totrue.Enable the tenant-level load balancing and transfer features for all user tenants (excluding the
systenant and Meta tenant).obclient> 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;The preceding statements indicate that the values of
enable_rebalanceandenable_transferfor all user tenants are set totrue.Note
Starting from OceanBase Database V4.2.1,
TENANT = all_userandTENANT = allhave the same semantics. When you need to specify all user tenants, we recommend that you useTENANT = all_user.TENANT = allwill be deprecated.
Configure the load balancing strategy for the current tenant.
MySQL modeOracle modeThe following statements enable the tenant-level load balancing and transfer features for a MySQL tenant:
obclient> ALTER SYSTEM SET enable_rebalance = true;obclient> ALTER SYSTEM SET enable_transfer = true;The following statements enable the tenant-level load balancing and transfer features for an Oracle tenant:
obclient> ALTER SYSTEM SET enable_rebalance = 'true';obclient> ALTER SYSTEM SET enable_transfer = 'true';