tikv / tikv/pd

Speed up the progress if the master zone changes

Open
#9,769 0 comments 0 reactions 0 assignees View on GitHub
type/enhancement
Dominant language
Go
Stars
1.2k
Forks
783
Avg merge
5d 21h
Merged PRs (30d)
36

Description

## Enhancement Task
Currently, after the user changes the master zone, the region checker needs to generate six operators to fix this region.

For example:
The previous rule:
```
[
{
"group_id": "pd",
"group_index": 0,
"group_override": false,
"rules": [
{
"group_id": "pd",
"id": "wl",
"start_key": "",
"end_key": "",
"role": "learner",
"count": 3,
"location_labels": ["zone", "az", "host"],
"label_constraints": [
{
"key": "zone",
"op": "in",
"values": ["wl"]
}
]
},
{
"group_id": "pd",
"id": "sh",
"start_key": "",
"end_key": "",
"role": "voter",
"count": 3,
"location_labels": ["zone", "az", "host"],
"label_constraints": [
{
"key": "zone",
"op": "in",
"values": ["sh"]
}
]
}
]
}
]
```

current rule:
```
[
{
"group_id": "pd",
"group_index": 0,
"group_override": false,
"rules": [
{
"group_id": "pd",
"id": "wl",
"start_key": "",
"end_key": "",
"role": "learner",
"count": 3,
"location_labels": ["zone", "az", "host"],
"label_constraints": [
{
"key": "zone",
"op": "in",
"values": ["wl"]
}
]
},
{
"group_id": "pd",
"id": "sh",
"start_key": "",
"end_key": "",
"role": "voter",
"count": 3,
"location_labels": ["zone", "az", "host"],
"label_constraints": [
{
"key": "zone",
"op": "in",
"values": ["sh"]
}
]
}
]
}
]
```

It needs six operators, including 3 promote and 3 demote peers to fix it; we can combine them into one operator, including six steps.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.