The region label ID is not isolated by keyspace.
- Dominant language
- Go
- Stars
- 1.2k
- Forks
- 783
- Avg merge
- 5d 21h
- Merged PRs (30d)
- 36
Description
## Bug Report
### What did you do?
```
CREATE TABLE employees (
id INT NOT NULL,
fname VARCHAR(30),
lname VARCHAR(30),
hired DATE NOT NULL DEFAULT '1970-01-01',
separated DATE DEFAULT '9999-12-31',
job_code INT,
store_id INT
)
PARTITION BY RANGE ( YEAR(separated) ) (
PARTITION p0 VALUES LESS THAN (1991),
PARTITION p1 VALUES LESS THAN (1996),
PARTITION p2 VALUES LESS THAN (2001),
PARTITION p3 VALUES LESS THAN MAXVALUE
);
ALTER TABLE employees PARTITION p0 ATTRIBUTES 'merge_option=deny';
```
### What did you expect to see?
Region id is isolated by keyspaceID;
### What did you see instead?
```
curl "http://127.0.0.1:2379/pd/api/v1/config/region-label/rules"
[
{
"id": "schema/test/employees/p0",
"index": 3,
"labels": [
{
"key": "merge_option",
"value": "deny"
},
{
"key": "db",
"value": "test"
},
{
"key": "table",
"value": "employees"
},
{
"key": "partition",
"value": "p0"
}
],
"rule_type": "key-range",
"data": [
{
"start_key": "7480000000000000ff6f00000000000000f8",
"end_key": "7480000000000000ff7000000000000000f8"
}
]
},
...
]
```
### What version of PD are you using (`pd-server -V`)?
master branch
Contributor guide
Assessment
This issue has not been assessed yet.