placement-rule rule-bundle delete rule/group doesn't works as expected
- Dominant language
- Go
- Stars
- 1.2k
- Forks
- 783
- Avg merge
- 5d 21h
- Merged PRs (30d)
- 36
Description
## Bug Report
### What did you do?
The command for deleting the rule returned success, but the rule still exists.
```
sh-4.2# tiup ctl:nightly pd -u http://pd1-peer.dr-autosync-hongmei-testbedgg9c2:2379/ config placement-rule rule-bundle delete dc1
Starting component `ctl`: /root/.tiup/components/ctl/v7.2.0-alpha-nightly-20230525/ctl /root/.tiup/components/ctl/v7.2.0-alpha-nightly-20230525/ctl pd -u http://pd1-peer.dr-autosync-hongmei-testbedgg9c2:2379/ config placement-rule rule-bundle delete dc1
"Delete group and rules successfully."
sh-4.2# tiup ctl:nightly pd -u http://pd1-peer.dr-autosync-hongmei-testbedgg9c2:2379/ config placement-rule rule-bundle get pd
Starting component `ctl`: /root/.tiup/components/ctl/v7.2.0-alpha-nightly-20230525/ctl /root/.tiup/components/ctl/v7.2.0-alpha-nightly-20230525/ctl pd -u http://pd1-peer.dr-autosync-hongmei-testbedgg9c2:2379/ config placement-rule rule-bundle get pd
{
"group_id": "pd",
"group_index": 0,
"group_override": false,
"rules": [
{
"group_id": "pd",
"id": "dc1",
"start_key": "",
"end_key": "",
"role": "voter",
"is_witness": false,
"count": 3,
```
There are two groups, one can be deleted, while the other can't.
```
sh-4.2# tiup ctl:nightly pd -u http://pd1-peer.dr-autosync-hongmei-testbedgg9c2:2379/ config placement-rule rule-bundle get default-group
Starting component `ctl`: /root/.tiup/components/ctl/v7.2.0-alpha-nightly-20230525/ctl /root/.tiup/components/ctl/v7.2.0-alpha-nightly-20230525/ctl pd -u http://pd1-peer.dr-autosync-hongmei-testbedgg9c2:2379/ config placement-rule rule-bundle get default-group
{
"group_id": "default-group",
"group_index": 0,
"group_override": false,
"rules": null
}
sh-4.2# tiup ctl:nightly pd -u http://pd1-peer.dr-autosync-hongmei-testbedgg9c2:2379/ config placement-rule rule-bundle delete pd
Starting component `ctl`: /root/.tiup/components/ctl/v7.2.0-alpha-nightly-20230525/ctl /root/.tiup/components/ctl/v7.2.0-alpha-nightly-20230525/ctl pd -u http://pd1-peer.dr-autosync-hongmei-testbedgg9c2:2379/ config placement-rule rule-bundle delete pd
[500] "[PD:placement:ErrBuildRuleList]build rule list failed, no rule left"
sh-4.2# tiup ctl:nightly pd -u http://pd1-peer.dr-autosync-hongmei-testbedgg9c2:2379/ config placement-rule rule-bundle delete default-group
Starting component `ctl`: /root/.tiup/components/ctl/v7.2.0-alpha-nightly-20230525/ctl /root/.tiup/components/ctl/v7.2.0-alpha-nightly-20230525/ctl pd -u http://pd1-peer.dr-autosync-hongmei-testbedgg9c2:2379/ config placement-rule rule-bundle delete default-group
"Delete group and rules successfully.
```
### What did you expect to see?
### What did you see instead?
### What version of PD are you using (`pd-server -V`)?
nightly
Contributor guide
Assessment
This issue has not been assessed yet.