Note
This parameter was introduced in V4.2.1.
Description
The enable_transfer parameter specifies whether to allow transfer within a tenant. This parameter is ineffective when the enable_rebalance parameter is set to false.
Attributes
| Attribute | Description |
|---|---|
| Parameter type | BOOL |
| Default value | True |
| Value range |
|
| Changeable | Yes. It can be changed by using the ALTER SYSTEM SET statement. |
| Restart required | No |
Considerations
The load balancing strategy within a tenant is jointly controlled by the tenant-level enable_rebalance and enable_transfer parameters.
The enable_rebalance parameter is used to control whether to perform load balancing among tenants. In a user tenant, it is also used to control whether to perform load balancing within the tenant. The default value is true. The setting takes effect immediately without the need to restart the OBServer node.
The enable_transfer parameter is used to control whether to enable the transfer feature within 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
enable_rebalanceis set tofalse, the system does not perform automatic load balancing regardless of whether the value ofenable_transferistrueorfalse. The command to disable all load balancing features is as follows:obclient> ALTER SYSTEM SET enable_rebalance=false;If both
enable_rebalanceandenable_transferare set totrue, the system automatically adjusts partition distribution during tenant scaling to achieve load balancing. The commands to dynamically adjust the number of log streams and automatically perform leader and partition balancing are as follows:obclient> ALTER SYSTEM SET enable_rebalance=true; obclient> ALTER SYSTEM SET enable_transfer=true;If
enable_rebalanceis set totrueandenable_transferis set tofalse, the system cannot initiate transfer operations during tenant scaling, but can implement limited load balancing through log stream migration. The command to perform log stream balancing based on existing log streams without generating transfers or causing dynamic changes in the number of log streams is as follows:obclient> ALTER SYSTEM SET enable_rebalance=true; obclient> ALTER SYSTEM SET enable_transfer=false;
Examples
The system tenant sets the load balancing strategy for a specified tenant.
The system tenant enables intra-tenant load balancing and the transfer feature for a 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 only set the values of the
enable_rebalanceandenable_transferparameters totruefor the specified tenant.The system tenant enables intra-tenant load balancing and the transfer feature for all user tenants (excluding the
systenant and the 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;In this case, the values of the
enable_rebalanceandenable_transferparameters are set totruefor all user tenants.Note
Starting from OceanBase Database V4.2.1,
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.
A user tenant sets the load balancing strategy for the current tenant.
MySQL modeOracle modeYou can execute the following statements to enable intra-tenant 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 intra-tenant load balancing and the transfer feature for an Oracle tenant:
obclient> ALTER SYSTEM SET enable_rebalance = 'true';obclient> ALTER SYSTEM SET enable_transfer = 'true';