Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The region label ID is not isolated by keyspace. #9081

Open
ystaticy opened this issue Feb 18, 2025 · 0 comments
Open

The region label ID is not isolated by keyspace. #9081

ystaticy opened this issue Feb 18, 2025 · 0 comments
Labels
type/bug The issue is confirmed as a bug.

Comments

@ystaticy
Copy link
Contributor

ystaticy commented Feb 18, 2025

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

@ystaticy ystaticy added the type/bug The issue is confirmed as a bug. label Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

1 participant