Note
This parameter is available starting with V4.2.0.
Description
The standby_db_preferred_upstream_log_region parameter specifies the preferred region for log synchronization of a standby tenant.
Privilege requirements
Query the parameter
The
systenant and all user tenants can query this parameter by using theSHOW PARAMETERSstatement or theGV$OB_PARAMETERSview.Modify the parameter
The
systenant and user tenants can modify this parameter.
Attributes
| Attribute | Description |
|---|---|
| Type | String |
| Default value | The default value is an empty string. This indicates that the system selects a server and obtains logs based on the default strategy. |
| Value range | The value is the name of a region in the OceanBase cluster. |
| Modifiable | Yes. You can use the ALTER SYSTEM SET statement to modify the parameter. |
| Effective upon OBServer node restart | No. The setting takes effect immediately. |
Considerations
After you specify the preferred region for log synchronization of a standby tenant by using the
standby_db_preferred_upstream_log_regionparameter, the standby tenant first synchronizes logs from a server in the specified region. To ensure high availability, if the standby tenant cannot obtain logs from all servers in the specified region, the system switches to another region based on a certain strategy to synchronize logs. The system then attempts to switch back to the specified region to continue log synchronization within a period of time.This parameter supports dynamic adjustment. When the standby tenant detects a change in the specified region for log synchronization, the system adjusts the priority in real time to switch servers.
Examples
Set the preferred region for log synchronization of a standby tenant in the
systenant of the cluster where the standby tenant resides.obclient> ALTER SYSTEM SET standby_db_preferred_upstream_log_region='BEIJING' tenant = 'restore_mysql_tenant';Set the preferred region for log synchronization of the current standby tenant.
obclient> ALTER SYSTEM SET standby_db_preferred_upstream_log_region='BEIJING';