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

Placement cannot add learner with the rule #7185

Closed
nolouch opened this issue Oct 10, 2023 · 0 comments · Fixed by #7219
Closed

Placement cannot add learner with the rule #7185

nolouch opened this issue Oct 10, 2023 · 0 comments · Fixed by #7219

Comments

@nolouch
Copy link
Contributor

nolouch commented Oct 10, 2023

Bug Report

What did you do?

region:

[root@tc-pd-0 /]# ./pd-ctl region 10894
{
  "id": 10894,
  "start_key": "7480000000000003FFBD00000000000000F8",
  "end_key": "7480000000000003FFBE00000000000000F8",
  "epoch": {
    "conf_ver": 95,
    "version": 478
  },
  "peers": [
    {
      "role_name": "Voter",
      "id": 10895,
      "store_id": 7
    },
    {
      "role_name": "Voter",
      "id": 10898,
      "store_id": 33
    },
    {
      "role_name": "Voter",
      "id": 10899,
      "store_id": 16
    }
  ],
  "leader": {
    "role_name": "Voter",
    "id": 10895,
    "store_id": 7
  },
  "cpu_usage": 0,
  "written_bytes": 0,
  "read_bytes": 0,
  "written_keys": 0,
  "read_keys": 0,
  "approximate_size": 1,
  "approximate_keys": 0
}

ruleFit:

[root@tc-pd-0 /]# curl http://127.0.0.1:2379/pd/api/v1/config/rules/region/10894/detail
{
  "rule-fits": [
    {
      "rule": {
        "group_id": "TiDB_DDL_957",
        "id": "table_rule_957_0",
        "index": 40,
        "start_key": "7480000000000003ffbd00000000000000f8",
        "end_key": "7480000000000003ffbe00000000000000f8",
        "role": "voter",
        "is_witness": false,
        "count": 3,
        "label_constraints": [
          {
            "key": "engine",
            "op": "notIn",
            "values": [
              "tiflash"
            ]
          }
        ],
        "version": 5,
        "create_timestamp": 1696924085
      },
      "peers": [
        {
          "id": 10895,
          "store_id": 7
        },
        {
          "id": 10898,
          "store_id": 33
        },
        {
          "id": 10899,
          "store_id": 16
        }
      ],
      "peers-different-role": null,
      "isolation-score": 0,
      "witness-score": 0
    },
    {
      "rule": {
        "group_id": "TiDB_DDL_957",
        "id": "table_rule_957_1",
        "index": 40,
        "start_key": "7480000000000003ffbd00000000000000f8",
        "end_key": "7480000000000003ffbe00000000000000f8",
        "role": "learner",
        "is_witness": false,
        "count": 3,
        "label_constraints": [
          {
            "key": "disk",
            "op": "in",
            "values": [
              "ssd"
            ]
          },
          {
            "key": "engine",
            "op": "notIn",
            "values": [
              "tiflash"
            ]
          }
        ],
        "version": 4,
        "create_timestamp": 1696924209
      },
      "peers": null,
      "peers-different-role": null,
      "isolation-score": 0,
      "witness-score": 0
    }
  ],
  "orphan-peers": null
}

image

store 7,33,16 is labeled as ssd,rule check cannot generate operator to add learner

What did you expect to see?

rule check cannot generate operator to add learner (expect 3 learners)

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

master + master tidb

@nolouch nolouch added the type/bug The issue is confirmed as a bug. label Oct 10, 2023
ti-chi-bot bot added a commit that referenced this issue Oct 23, 2023
…egionFit (#7219)

close #7185

fix the issue of not being able to achieve the better RegionFit
- try to replace the existing peer in another rulefit

Signed-off-by: nolouch <nolouch@gmail.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
ti-chi-bot bot added a commit that referenced this issue Oct 25, 2023
…egionFit (#7219) (#7245)

close #7185

fix the issue of not being able to achieve the better RegionFit
- try to replace the existing peer in another rulefit

Signed-off-by: nolouch <nolouch@gmail.com>

Co-authored-by: nolouch <nolouch@gmail.com>
Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
ti-chi-bot bot added a commit that referenced this issue Oct 26, 2023
…egionFit (#7219) (#7244)

close #7185

fix the issue of not being able to achieve the better RegionFit
- try to replace the existing peer in another rulefit

Signed-off-by: nolouch <nolouch@gmail.com>

Co-authored-by: nolouch <nolouch@gmail.com>
Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

2 participants