Note
This parameter is introduced since 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 | BOOL |
| Default value | True |
| Value range |
|
| Modifiable | Yes. It can be modified using the ALTER SYSTEM SET statement. |
| Effective upon OBServer node restart | No |
Considerations
The load balancing strategy within the tenant is jointly controlled by the tenant-level parameters enable_rebalance and enable_transfer.
The enable_rebalance parameter is used in the sys tenant to control whether cross-tenant load balancing is performed, and in the user tenant to control whether intra-tenant balancing is performed. The default value is true. The setting takes effect immediately without the need of restarting the OBServer node.
The enable_transfer parameter is used to control whether the transfer feature is enabled within the tenant. The default value is true, and the setting takes effect immediately without the need of restarting the OBServer node. The meaning of the enable_transfer value depends on the value of the enable_rebalance parameter.
If the value of
enable_rebalanceisfalse, regardless of whether the value ofenable_transferistrueorfalse, the system will not perform automatic load balancing. The command to disable all load balancing is as follows:obclient> ALTER SYSTEM SET enable_rebalance=false;If both the value of
enable_rebalanceandenable_transferistrue, it indicates that during tenant scaling, the system will automatically adjust the partition distribution to achieve load balancing. The commands for dynamically adjusting the number of tenant log streams based on the load balancing algorithm, and automatically performing tenant-level leader balance and partition balance are 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, it indicates that during tenant scaling, the system cannot initiate transfer operations and can only achieve limited balancing through log stream migration. The commands for performing only log stream balancing based on the existing log stream without generating transfer 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
Set the the load balancing strategy for a specified tenant from the sys tenant.
Enable intra-tenant load balancing and transfer 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 above statements indicate that only the values of the parameters
enable_rebalanceandenable_transferare set totruefor the specified tenant.Enable cross-tenant load balancing and transfer 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 above statements indicate that the values of the parameters
enable_rebalanceandenable_transferare set totruefor all user tenants.Note
Starting from OceanBase Database V4.2.1, the semantic of
TENANT = all_useris the same asTENANT = all. When the scope of application needs to cover all user tenants, it is recommended to useTENANT = all_user.TENANT = allwill be deprecated and no longer supported.
Set the the load balancing strategy for the current tenant from the user tenant.
MySQL modeOracle modeThe statement to enable intra-tenant load balancing and transfer for the current MySQL tenant is as follows:
obclient> ALTER SYSTEM SET enable_rebalance = true;obclient> ALTER SYSTEM SET enable_transfer = true;The statement to enable intra-tenant load balancing and transfer for the current Oracle tenant is as follows:
obclient> ALTER SYSTEM SET enable_rebalance = 'true';obclient> ALTER SYSTEM SET enable_transfer = 'true';