Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: 使用Placement Policy后,非default策略的location_labels不再生效
When replacing the TiKV machine in Zone D, it was found that after using the Placement policy, during scaling, the Regions of all nodes would increase/decrease, and it was not limited to Zone D. The Region change curves are as follows:
- In the default
PLACEMENT POLICY
, the curve of the number of Regions when replacing TiKV in Zone D is:
- After using other
PLACEMENT POLICY
, the curve of the number of Regions when replacing TiKV in Zone D is:
Directly using pd-ctl to check the Placement Rule in PD, the contents are as follows:
-
- The default global strategy, which includes location_labels content
{
"group_id": "pd",
"group_index": 0,
"group_override": false,
"rules": [
{
"group_id": "pd",
"id": "default",
"start_key": "",
"end_key": "",
"role": "voter",
"is_witness": false,
"count": 3,
"label_constraints": [
{
"key": "disk",
"op": "notIn",
"values": [
"sata",
"sata-new",
"dw-ssd"
]
}
],
"location_labels": [
"zone",
"dc",
"host"
]
}
]
},
-
- The one generated by using
Placement rule in SQL
is as follows, lackinglocation_labels
content
- The one generated by using
{
"group_id": "TiDB_DDL_89632",
"id": "partition_rule_89632_1",
"index": 40,
"start_key": "748000000000015eff2000000000000000f8",
"end_key": "748000000000015eff2100000000000000f8",
"role": "voter",
"is_witness": false,
"count": 2,
"label_constraints": [
{
"key": "disk",
"op": "in",
"values": [
"dw-ssd"
]
},
{
"key": "engine",
"op": "notIn",
"values": [
"tiflash"
]
}
],
"create_timestamp": 1706864872
}