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

Hot write may break the constraint of placement policy #7848

Closed
rleungx opened this issue Feb 23, 2024 · 2 comments · Fixed by #7852
Closed

Hot write may break the constraint of placement policy #7848

rleungx opened this issue Feb 23, 2024 · 2 comments · Fixed by #7852
Labels

Comments

@rleungx
Copy link
Member

rleungx commented Feb 23, 2024

Enhancement Task

Consider we have two zones: z1 and z2. And store 1 and 2 in z1, store 3, 4, 5, 6 is in z2. We use the following placement policy:

create placement policy apread1 LEADER_CONSTRAINTS="[+zone=z1]" FOLLOWER_CONSTRAINTS='{"+zone=z2": 2}';

On the PD side, it will synchronize two rules one is the leader rule, and the other is the voter rule. The hot write peer scheduling might break the constraint, and create the following operator:

move-hot-write-peer {mv peer: store [1] to [2]} (kind:hot-region,region,leader, region:1(0, 0), createAt:2024-02-23 11:53:35.168782469 +0800 CST m=+0.026292131, startAt:0001-01-01 00:00:00 +0000 UTC, currentStep:0, size:0, steps:[0:{add learner peer 11 on store 2}, 1:{transfer leader from store 1 to store 3}, 2:{use joint consensus, promote learner peer 11 on store 2 to voter, demote voter peer 1 on store 1 to learner}, 3:{leave joint state, promote learner peer 11 on store 2 to voter, demote voter peer 1 on store 1 to learner}, 4:{remove peer on store 1}], timeout:[18m0s])

But if we use another placement policy with evcit-leader attribute

create placement policy apread1 LEADER_CONSTRAINTS="[+zone=z1]" FOLLOWER_CONSTRAINTS='{"+zone=z2, #evict-leader": 2}';

On the PD side, it will synchronize two rules one is the leader rule, and the other is the follower rule, then the operator change to:

move-hot-write-peer {mv peer: store [1] to [2]} (kind:hot-region,region,leader, region:1(0, 0), createAt:2024-02-23 11:57:12.608195316 +0800 CST m=+0.029869347, startAt:0001-01-01 00:00:00 +0000 UTC, currentStep:0, size:0, steps:[0:{add learner peer 11 on store 2}, 1:{use joint consensus, promote learner peer 11 on store 2 to voter, demote voter peer 1 on store 1 to learner}, 2:{transfer leader from store 1 to store 2}, 3:{leave joint state, promote learner peer 11 on store 2 to voter, demote voter peer 1 on store 1 to learner}, 4:{remove peer on store 1}], timeout:[18m0s])

No matter the way we use to config placement policy, the operator should always be the latter one.

@rleungx rleungx added the type/enhancement The issue or PR belongs to an enhancement. label Feb 23, 2024
@rleungx rleungx changed the title Hot write will break the constraint of placement policy Hot write may break the constraint of placement policy Feb 23, 2024
@rleungx
Copy link
Member Author

rleungx commented Feb 23, 2024

/cc @lhy1024

ti-chi-bot bot added a commit that referenced this issue Feb 26, 2024
ref #7848

Signed-off-by: Ryan Leung <[email protected]>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this issue Mar 31, 2024
ti-chi-bot bot added a commit that referenced this issue Apr 12, 2024
close #7848

Signed-off-by: lhy1024 <[email protected]>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this issue Apr 12, 2024
ti-chi-bot bot pushed a commit that referenced this issue Apr 15, 2024
close #7848

Signed-off-by: ti-chi-bot <[email protected]>
Signed-off-by: lhy1024 <[email protected]>

Co-authored-by: lhy1024 <[email protected]>
Co-authored-by: lhy1024 <[email protected]>
ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this issue May 7, 2024
ti-chi-bot bot pushed a commit that referenced this issue May 20, 2024
close #7848

Signed-off-by: lhy1024 <[email protected]>

Co-authored-by: lhy1024 <[email protected]>
Co-authored-by: lhy1024 <[email protected]>
@seiya-annie
Copy link

/found customer

@ti-chi-bot ti-chi-bot bot added the report/customer Customers have encountered this bug. label Jun 4, 2024
ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this issue Jun 4, 2024
ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this issue Jul 29, 2024
ti-chi-bot bot pushed a commit that referenced this issue Jul 29, 2024
close #7848

Signed-off-by: ti-chi-bot <[email protected]>
Signed-off-by: lhy1024 <[email protected]>

Co-authored-by: lhy1024 <[email protected]>
Co-authored-by: lhy1024 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants