rule_list: should we consider a peer should be leader and follower in 2 rules in `checkApplyRules`
AndreMouche opened this issue · comments
Shirly commented
Bug Report
when we try to add new placement-rule into the cluster, we would use the following function to check whether the new rule has conflictions with some exist rules.
pd/pkg/schedule/placement/rule_list.go
Lines 27 to 46 in fca469c
however, the above function miss the following corner case, which would save conflict placement-rule in the system:
both zone has only 1 tikv instance and the rule defines as the following:
leader should in tikv1, follower should in tikv1, for example:
CREATE PLACEMENT POLICY leader_follower_in_1 LEADER_CONSTRAINTS="[+zone=bj1]" FOLLOWER_CONSTRAINTS="{+zone=bj1: 1,+zone=bj3: 1}";
the above function will return success, while we could never make the replica on tikv1 meet these 2 rules at the same time.