rule_list: should we consider a peer should be leader and follower in 2 rules in `checkApplyRules`
- Dominant language
- Go
- Stars
- 1.2k
- Forks
- 783
- Avg merge
- 5d 21h
- Merged PRs (30d)
- 36
Description
## 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.
https://github.com/tikv/pd/blob/fca469ca33eb5d8b5e0891b507c87709a00b0e81/pkg/schedule/placement/rule_list.go#L27-L46)
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.
Contributor guide
Assessment
This issue has not been assessed yet.