proxy_route_policy specifies the routing strategy for weak-consistency read requests in OceanBase Database Proxy (ODP), which defines the backend server to which client requests are routed for processing.
Note
The TARGET_REPLICA_TYPE_WITH_LEADER, TARGET_REPLICA_TYPE_FOLLOWER_FIRST, TARGET_REPLICA_TYPE_FOLLOWER_ONLY, and WEAKREAD_WEIGHT_LOAD_BALANCE values are added in ODP V4.3.2.
The parameter value is case-insensitive.
If you specify a value beyond the value range, the setting can be successful but does not take effect. In this case, ODP uses the default routing strategy for weak-consistency read requests.
| Attribute |
Description |
| Parameter type |
String |
| Default value |
'', which indicates an empty string |
| Value range |
- Empty string: The default routing strategy (
MERGE_IDC_ORDER) of ODP is used. In this strategy, weak-consistency read requests can be routed to followers and read-only replicas.
FOLLOWER_FIRST: Read requests are preferentially routed to followers. If all the followers are unavailable, the requests are routed to the leader.
FOLLOWER_ONLY: Read requests are routed only to followers. If all the followers are unavailable, the connection to the client is terminated.
UNMERGE_FOLLOWER_FIRST: Read requests are preferentially routed to a follower of which the cluster is not in a major compaction.
TARGET_REPLICA_TYPE_WITH_LEADER: Read requests are routed to specified replicas. In this strategy, the leader and followers have the same prority. The replica type is specified by route_target_replica_type.
TARGET_REPLICA_TYPE_FOLLOWER_FIRST: Read requests are routed to specified replicas and to followers preferentially. If all specified followers are unavailable, read requests are routed to the leader. The replica type is specified by route_target_replica_type.
TARGET_REPLICA_TYPE_FOLLOWER_ONLY: Read requests are routed to specified followers. If all specified followers are unavailable, the connection to the client is terminated. The replica type is specified by route_target_replica_type.
WEAKREAD_WEIGHT_LOAD_BALANCE: Load-balanced routing is performed based on weights. You can use specify the weakread_weight_zone parameter to set a weight for each zone in the cluster.
|
| Effective upon ODP restart |
No |
Notice
When route_target_replica_type is set to ColumnStore, ODP routes read requests only to columnstore replicas instead of the leader.
References