Note
- For OceanBase Database V4.3.x, this parameter was introduced in OceanBase Database V4.3.2.
- For OceanBase Database V4.2.x, this parameter was introduced in OceanBase Database V4.2.1 BP7 and V4.2.3.
Description
choose_migration_source_policy specifies the prioritizing strategy for selecting the source replica for migration.
Limitations
Query the parameter
In the
systenant or a user tenant, you can execute theSHOW PARAMETERSstatement to query the parameter or query theGV$OB_PARAMETERSview for the parameter.Modify the parameter
You can use the
ALTER SYSTEM SETstatement to modify the parameter in thesystenant or a user tenant.
Attributes
| Attribute | Description |
|---|---|
| Type | String |
| Default value | idc |
| Value range |
|
| 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
The network relationships between the migration source and destination with respect to location are defined as follows: same IDC, same region but different IDCs, and different regions.
choose_migration_source_policyis set toidc:A follower in the same IDC is preferentially selected as the migration source. If multiple followers meet the requirement, any one of them is selected. If no follower meets the requirement, the leader meeting the requirement is selected. If no replica in the same IDC meets the requirement, a replica is selected from other IDCs within the same region.
choose_migration_source_policyis set toregion:Same region but different IDCs
A follower in the same region is preferentially selected as the migration source. If multiple followers meet the requirement, any one of them is selected. If no follower meets the requirement, the leader meeting the requirement is selected. If no replica in the same region meets the requirement, a replica is selected from other regions.
Different regions
A follower in other regions is preferentially selected as the migration source. If multiple followers meet the requirement, any one of them is selected. If no replica in other regions meets the requirement, error
4600is returned.
In the same region, if bandwidth across different IDCs is significantly smaller than that within the same IDC, we recommend that you set this parameter to
idc. If the bandwidth difference is not significant, we recommend that you set this parameter toregion.You must correctly specify the location information of OBServer nodes. Otherwise, the migration source feature cannot run properly.
Examples
Configure to preferentially select a replica in the same IDC as the migration source.
obclient> ALTER SYSTEM SET choose_migration_source_policy='idc';