Skip to content

Placement rule in SQL isn't compatible with rule checker when using location labels #6637

@rleungx

Description

@rleungx

Bug Report

What did you do?

Consider we have a cluster (three zones, each zone has a host, and each host has multiple instances)

zone1 --- host1 --- ap --- (kv1, kv2)
zone2 --- host2 --- ap --- (kv3, kv4)
zone3 --- host3 --- tp --- (kv5, kv6)

If we create the following placement policy:

create placement policy p leader_constraints="[+type=ap]" follower_constraint={+type=ap:1, +type=tp:1}", survival_preferences="[host]";

What did you expect to see?

The region peer won't be distributed in the same host.

What did you see instead?

There will be three rules in PD, and each of them has a location label setting. However, each rule's count is 1, and the location label only takes effect in one rule.

So, we still can find two replicas of a region in a host.

What version of PD are you using (pd-server -V)?

master

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects-6.5This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.affects-7.2severity/majortype/bugThe issue is confirmed as a bug.

    Type

    No type

    Projects

    Status

    Closed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions