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

Improve the error report of placement rule #47253

Open
Tracked by #45384
nolouch opened this issue Sep 25, 2023 · 3 comments
Open
Tracked by #45384

Improve the error report of placement rule #47253

nolouch opened this issue Sep 25, 2023 · 3 comments
Assignees
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. type/enhancement The issue or PR belongs to an enhancement.

Comments

@nolouch
Copy link
Member

nolouch commented Sep 25, 2023

Enhancement

mysql> show placement;
+--------------------+-----------------------------------------------------------------------------------------------------+------------------+
| Target             | Placement                                                                                           | Scheduling_State |
+--------------------+-----------------------------------------------------------------------------------------------------+------------------+
| POLICY all_in_east | CONSTRAINTS="[+region=us-east-1]"                                                                   | NULL             |
| POLICY mydeploy    | FOLLOWER_CONSTRAINTS="{ \"+region=us-east-1\":1, \"+region=us-east-2\": 2, \"+region=us-west\": 1}" | NULL             |
| TABLE test.t       | CONSTRAINTS="[+region=us-east-1]"                                                                   | PENDING          |
| TABLE test.t1      | CONSTRAINTS="[+region=us-east-1]"                                                                   | PENDING          |
+--------------------+-----------------------------------------------------------------------------------------------------+------------------+
4 rows in set (0.00 sec)

mysql> alter table t placement policy mydeploy;
ERROR 8243 (HY000): "[PD:placement:ErrRuleContent]invalid rule content, rule 'table_rule_105_1' from rule group 'TiDB_DDL_105' can not match any store"

I don't know why 'TiDB_DDL_105' can not match any store, and which policy has problem.

Details Topogy:

{
  "count": 5,
  "stores": [
    {
      "store": {
        "id": 1,
        "address": "127.0.0.1:20163",
        "labels": [
          {
            "key": "region",
            "value": "us-east-1"
          }
        ],
        "version": "7.3.0",
        "peer_address": "127.0.0.1:20163",
        "status_address": "127.0.0.1:20183",
        "git_hash": "076c6a03cba91b6e9a2e5b227a800f98a01c53e5",
        "start_timestamp": 1695628575,
        "deploy_path": "/Users/nolouch/.tiup/components/tikv/v7.3.0",
        "last_heartbeat": 1695635849824517000,
        "state_name": "Up"
      },
      "status": {
        "capacity": "926.4GiB",
        "available": "425.9GiB",
        "used_size": "289.1MiB",
        "leader_count": 3,
        "leader_weight": 1,
        "leader_score": 3,
        "leader_size": 3,
        "region_count": 5,
        "region_weight": 1,
        "region_score": 7.513273365437039,
        "region_size": 5,
        "slow_score": 1,
        "slow_trend": {
          "cause_value": 250019.23333333334,
          "cause_rate": 0,
          "result_value": 0,
          "result_rate": 0
        },
        "start_ts": "2023-09-25T15:56:15+08:00",
        "last_heartbeat_ts": "2023-09-25T17:57:29.824517+08:00",
        "uptime": "2h1m14.824517s"
      }
    },
    {
      "store": {
        "id": 2,
        "address": "127.0.0.1:20162",
        "labels": [
          {
            "key": "region",
            "value": "us-east-1"
          }
        ],
        "version": "7.3.0",
        "peer_address": "127.0.0.1:20162",
        "status_address": "127.0.0.1:20182",
        "git_hash": "076c6a03cba91b6e9a2e5b227a800f98a01c53e5",
        "start_timestamp": 1695628575,
        "deploy_path": "/Users/nolouch/.tiup/components/tikv/v7.3.0",
        "last_heartbeat": 1695635849704162000,
        "state_name": "Up"
      },
      "status": {
        "capacity": "926.4GiB",
        "available": "425.9GiB",
        "used_size": "289.5MiB",
        "leader_count": 3,
        "leader_weight": 1,
        "leader_score": 3,
        "leader_size": 3,
        "region_count": 6,
        "region_weight": 1,
        "region_score": 9.015928071609622,
        "region_size": 6,
        "slow_score": 1,
        "slow_trend": {
          "cause_value": 250016.55,
          "cause_rate": 0,
          "result_value": 0,
          "result_rate": 0
        },
        "start_ts": "2023-09-25T15:56:15+08:00",
        "last_heartbeat_ts": "2023-09-25T17:57:29.704162+08:00",
        "uptime": "2h1m14.704162s"
      }
    },
    {
      "store": {
        "id": 3,
        "address": "127.0.0.1:20164",
        "labels": [
          {
            "key": "region",
            "value": "us-east-2"
          }
        ],
        "version": "7.3.0",
        "peer_address": "127.0.0.1:20164",
        "status_address": "127.0.0.1:20184",
        "git_hash": "076c6a03cba91b6e9a2e5b227a800f98a01c53e5",
        "start_timestamp": 1695628575,
        "deploy_path": "/Users/nolouch/.tiup/components/tikv/v7.3.0",
        "last_heartbeat": 1695635849974441000,
        "state_name": "Up"
      },
      "status": {
        "capacity": "926.4GiB",
        "available": "425.9GiB",
        "used_size": "289MiB",
        "leader_count": 0,
        "leader_weight": 1,
        "leader_score": 0,
        "leader_size": 0,
        "region_count": 6,
        "region_weight": 1,
        "region_score": 9.015927997013208,
        "region_size": 6,
        "slow_score": 1,
        "slow_trend": {
          "cause_value": 250017.025,
          "cause_rate": 0,
          "result_value": 0,
          "result_rate": 0
        },
        "start_ts": "2023-09-25T15:56:15+08:00",
        "last_heartbeat_ts": "2023-09-25T17:57:29.974441+08:00",
        "uptime": "2h1m14.974441s"
      }
    },
    {
      "store": {
        "id": 4,
        "address": "127.0.0.1:20160",
        "labels": [
          {
            "key": "region",
            "value": "us-east-2"
          }
        ],
        "version": "7.3.0",
        "peer_address": "127.0.0.1:20160",
        "status_address": "127.0.0.1:20180",
        "git_hash": "076c6a03cba91b6e9a2e5b227a800f98a01c53e5",
        "start_timestamp": 1695628575,
        "deploy_path": "/Users/nolouch/.tiup/components/tikv/v7.3.0",
        "last_heartbeat": 1695635849663426000,
        "state_name": "Up"
      },
      "status": {
        "capacity": "926.4GiB",
        "available": "425.9GiB",
        "used_size": "289.1MiB",
        "leader_count": 0,
        "leader_weight": 1,
        "leader_score": 0,
        "leader_size": 0,
        "region_count": 5,
        "region_weight": 1,
        "region_score": 7.513272089020848,
        "region_size": 5,
        "slow_score": 1,
        "slow_trend": {
          "cause_value": 250018.1,
          "cause_rate": 0,
          "result_value": 0,
          "result_rate": 0
        },
        "start_ts": "2023-09-25T15:56:15+08:00",
        "last_heartbeat_ts": "2023-09-25T17:57:29.663426+08:00",
        "uptime": "2h1m14.663426s"
      }
    },
    {
      "store": {
        "id": 5,
        "address": "127.0.0.1:20161",
        "labels": [
          {
            "key": "region",
            "value": "us-west-1"
          }
        ],
        "version": "7.3.0",
        "peer_address": "127.0.0.1:20161",
        "status_address": "127.0.0.1:20181",
        "git_hash": "076c6a03cba91b6e9a2e5b227a800f98a01c53e5",
        "start_timestamp": 1695628575,
        "deploy_path": "/Users/nolouch/.tiup/components/tikv/v7.3.0",
        "last_heartbeat": 1695635849693885000,
        "state_name": "Up"
      },
      "status": {
        "capacity": "926.4GiB",
        "available": "425.9GiB",
        "used_size": "289.2MiB",
        "leader_count": 3,
        "leader_weight": 1,
        "leader_score": 3,
        "leader_size": 3,
        "region_count": 5,
        "region_weight": 1,
        "region_score": 7.513273381969006,
        "region_size": 5,
        "slow_score": 1,
        "slow_trend": {
          "cause_value": 250020.06666666668,
          "cause_rate": 0,
          "result_value": 9,
          "result_rate": 0
        },
        "start_ts": "2023-09-25T15:56:15+08:00",
        "last_heartbeat_ts": "2023-09-25T17:57:29.693885+08:00",
        "uptime": "2h1m14.693885s"
      }
    }
  ]
}
@nolouch nolouch added the type/enhancement The issue or PR belongs to an enhancement. label Sep 25, 2023
@nolouch nolouch added the good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. label Sep 25, 2023
@ShatilKhan
Copy link

I'd like to work on this. Please assign me

@nolouch
Copy link
Member Author

nolouch commented Oct 25, 2023

/assign @ShatilKhan

@bb7133
Copy link
Member

bb7133 commented Jun 7, 2024

Hi @ShatilKhan , a friendly ping: are you still working on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

No branches or pull requests

3 participants