Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rule in SQL supports to define 2:2:1 cluster topology #47254

Closed
Tracked by #45384
nolouch opened this issue Sep 25, 2023 · 0 comments · Fixed by #47344
Closed
Tracked by #45384

Rule in SQL supports to define 2:2:1 cluster topology #47254

nolouch opened this issue Sep 25, 2023 · 0 comments · Fixed by #47344
Labels
type/enhancement The issue or PR belongs to an enhancement.

Comments

@nolouch
Copy link
Member

nolouch commented Sep 25, 2023

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:

  1. 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}'
  1. syntax sugar
CREATE PLACEMENT POLICY REGIONS="us-east-1,us-east-2,us-west-1" SCHEUDLE="replicas(2:2:1)"
@nolouch nolouch added the type/enhancement The issue or PR belongs to an enhancement. label Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant