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

reduce rule numbers if not set the role in the rule SQL #45395

Closed
Tracked by #45384
nolouch opened this issue Jul 17, 2023 · 0 comments · Fixed by #46529
Closed
Tracked by #45384

reduce rule numbers if not set the role in the rule SQL #45395

nolouch opened this issue Jul 17, 2023 · 0 comments · Fixed by #46529
Labels
type/enhancement The issue or PR belongs to an enhancement.

Comments

@nolouch
Copy link
Member

nolouch commented Jul 17, 2023

Problem

 create placement policy retail_pos constraints="[+retail_region=fast]";
 CREATE TABLE t1 (a INT);
 ALTER TABLE t1  PLACEMENT POLICY=retail_pos;

The rules in PD side:

[
  {
    "group_id": "TiDB_DDL_90",
    "id": "table_rule_90_0",
    "index": 40,
    "start_key": "7480000000000000ff5a00000000000000f8",
    "end_key": "7480000000000000ff5b00000000000000f8",
    "role": "leader",
    "is_witness": false,
    "count": 1,
    "label_constraints": [
      {
        "key": "retail_region",
        "op": "in",
        "values": [
          "fast"
        ]
      },
      ....
    ],
    "create_timestamp": 1689589620
  },
  {
    "group_id": "TiDB_DDL_90",
    "id": "table_rule_90_1",
    "index": 40,
    "start_key": "7480000000000000ff5a00000000000000f8",
    "end_key": "7480000000000000ff5b00000000000000f8",
    "role": "voter",
    "is_witness": false,
    "count": 2,
    "label_constraints": [
      {
        "key": "retail_region",
        "op": "in",
        "values": [
          "fast"
        ]
      },
      ...
    ],
    "create_timestamp": 1689589620
  },
  {
    "group_id": "pd",
    "id": "default",
    "start_key": "",
    "end_key": "",
    "role": "voter",
    "is_witness": false,
    "count": 3
  }
]

There is no need to split into two rules because we do not need to distinguish roles, two rules perhaps exist some problems. such as location-labels may not work in tikv/pd#6637

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant