tikv / tikv/pd

keyspaces creates strange region start key and end key

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

Description

## Bug Report

Seem that pd creates a keyspaces/0 rule by default.

```
curl http://127.0.0.1:2379/pd/api/v1/config/region-label/rules
[
{
"id": "keyspaces/0",
"index": 0,
"labels": [
{
"key": "id",
"value": "0"
}
],
"rule_type": "key-range",
"data": [
{
"start_key": "7200000000000000fb",
"end_key": "7200000100000000fb"
},
{
"start_key": "7800000000000000fb",
"end_key": "7800000100000000fb"
}
]
}
]
```

This rule will split the initial region `["", "")` into 5 regions with "strange" keys (tidb does not recognize these keys, and may cause TiDB panic).

[2023/09/08 10:04:20.368 +08:00] [INFO] [operator_controller.go:464] ["add operator"] [region-id=3] [operator="\"labeler-split-region {split: region 3 use policy USEKEY and keys [7200000000000000FB 7200000100000000FB 7800000000000000FB 7800000100000000FB]} (kind:split, region:3(1, 1), createAt:2023-09-08 10:04:20.368485844 +0800 CST m=+63.876226382, startAt:0001-01-01 00:00:00 +0000 UTC, currentStep:0, size:0, steps:[0:{split region with policy USEKEY}], timeout:[1m0s])\""] [additional-info="{\"region-end-key\":\"\",\"region-start-key\":\"\"}"]

Not sure if the rule is expected.

### What did you do?

Run TiDB cluster using multi-rocksdb TiKV cluster.

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

[2023/09/08 10:03:16.521 +08:00] [INFO] [versioninfo.go:89] ["Welcome to Placement Driver (PD)"]
[2023/09/08 10:03:16.521 +08:00] [INFO] [versioninfo.go:90] [PD] [release-version=v7.4.0-alpha]
[2023/09/08 10:03:16.521 +08:00] [INFO] [versioninfo.go:91] [PD] [edition=Community]
[2023/09/08 10:03:16.521 +08:00] [INFO] [versioninfo.go:92] [PD] [git-hash=74ead5cbdf17df955ad7075810be3a724033ca0f]
[2023/09/08 10:03:16.521 +08:00] [INFO] [versioninfo.go:93] [PD] [git-branch=heads/refs/tags/v7.4.0-alpha]
[2023/09/08 10:03:16.521 +08:00] [INFO] [versioninfo.go:94] [PD] [utc-build-time="2023-09-07 11:36:15"]

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.