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 IS_LEARNER field data in the TIKV_REGION_PEERS table is incorrect #24293

Closed
HunDunDM opened this issue Apr 26, 2021 · 1 comment
Closed
Labels
severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@HunDunDM
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

  • Randomly choose a Region containing Learner peer (commonly found in the cluster containing TiFlash)
  • pd-ctl region ${region_id}
  • SELECT * FROM INFORMATION_SCHEMA.TIKV_REGION_PEERS WHERE REGION_ID=${region_id};

2. What did you expect to see? (Required)

  • Their data should be consistent.

3. What did you see instead (Required)

  • Peer 104792 is a Learner but not in the SQL results.
region 83693
{
  "id": 83693,
  "start_key": "7480000000000000FF465F728000000000FF0555BF0000000000FA",
  "end_key": "7480000000000000FF465F728000000000FF06E05F0000000000FA",
  "epoch": {
    "conf_ver": 20,
    "version": 4516
  },
  "peers": [
    {
      "id": 83694,
      "store_id": 1
    },
    {
      "id": 83695,
      "store_id": 51
    },
    {
      "id": 83696,
      "store_id": 76
    },
    {
      "id": 104792,
      "store_id": 101,
      "role": 1
    }
  ],
  "leader": {
    "id": 83694,
    "store_id": 1
  },
  "written_bytes": 3300070,
  "read_bytes": 787118,
  "written_keys": 15994,
  "read_keys": 3226,
  "approximate_size": 56,
  "approximate_keys": 263273
}
SELECT * FROM INFORMATION_SCHEMA.TIKV_REGION_PEERS WHERE REGION_ID=83693;
+-----------+---------+----------+------------+-----------+--------+--------------+
| REGION_ID | PEER_ID | STORE_ID | IS_LEARNER | IS_LEADER | STATUS | DOWN_SECONDS |
+-----------+---------+----------+------------+-----------+--------+--------------+
|     83693 |   83694 |        1 |          0 |         1 | NORMAL |         NULL |
|     83693 |   83695 |       51 |          0 |         0 | NORMAL |         NULL |
|     83693 |   83696 |       76 |          0 |         0 | NORMAL |         NULL |
|     83693 |  104792 |      101 |          0 |         0 | NORMAL |         NULL |
+-----------+---------+----------+------------+-----------+--------+--------------+

4. What is your TiDB version? (Required)

Release Version: v5.0.0
Edition: Community
Git Commit Hash: bdac0885cd11bdf571aad9353bfc24e13554b91c
Git Branch: heads/refs/tags/v5.0.0
UTC Build Time: 2021-04-06 16:36:29
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false

5. Related ISSUE and PR

kvproto#658
pd#3372

@HunDunDM HunDunDM added the type/bug The issue is confirmed as a bug. label Apr 26, 2021
@HunDunDM HunDunDM changed the title The IS_LEARNER field data in the INFORMATION_SCHEMA.TIKV_REGION_PEERS table is incorrect The IS_LEARNER field data in the TIKV_REGION_PEERS table is incorrect May 25, 2021
@ti-srebot
Copy link
Contributor

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

6. Fixed versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

3 participants