-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
type/enhancementThe issue or PR belongs to an enhancement.The issue or PR belongs to an enhancement.
Description
Enhancement
Problems
The customer wants to define a cluster with 5 replicas and distributed in 3 regions, leader can be in every region. currently, the rule in SQL cannot conver it.
// cannot be 2:2:1 distributed
MySQL > create placement policy mydeploy FOLLOWER_CONSTRAINTS='{ "+region=us-east-1":1, "+region=us-east-2": 2, "+region=us-west-1": 1}';
// leader is located in us-east-1
MySQL > create placement policy mydeploy LEADER_CONSTRAINTS='{"+region=us-east-1":1}' FOLLOWER_CONSTRAINTS='{ "+region=us-east-1":1, "+region=us-east-2": 2, "+region=us-west-1": 1}';
// cannot create
mysql> create placement policy mydeploy221 CONSTRAINTS='{ "+region=us-east-1":2, "+region=us-east-2": 2, "+region=us-west-1": 1}';
ERROR 1105 (HY000): invalid label constraints format: 'Constraints' should be [constraint1, ...] or any yaml compatible array representation
Implement
Supports:
- supports high level policy for CONSTRAINTS
create placement policy mydeploy221 CONSTRAINTS='{ "+region=us-east-1":2, "+region=us-east-2": 2, "+region=us-west-1": 1}'
- syntax sugar
CREATE PLACEMENT POLICY REGIONS="us-east-1,us-east-2,us-west-1" SCHEUDLE="replicas(2:2:1)"
Metadata
Metadata
Assignees
Labels
type/enhancementThe issue or PR belongs to an enhancement.The issue or PR belongs to an enhancement.