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

infochema, server: export region_id in hot_region table #10982

Merged
merged 11 commits into from
Jul 11, 2019
Merged

infochema, server: export region_id in hot_region table #10982

merged 11 commits into from
Jul 11, 2019

Conversation

lysu
Copy link
Contributor

@lysu lysu commented Jun 28, 2019

What problem does this PR solve?

  • add REGION_ID to information_schema.TIDB_HOT_REGIONS so we can join other table to find sth like "hot store name", "hot key ranges".
  • add infinity timeout to fetch hot region info from pd api(this api is slow when there are too many regions, current timeout value is not suitable)
  • fix mistake for column order in TIKV_REGION_PEERS

What is changed and how it works?

just as above described

Check List

Tests

  • Manual test (add detailed scripts or steps below)

run sysbench prepare will saw this:

mysql> select * from TIDB_HOT_REGIONs;
+----------+----------+---------+------------+------------+-----------+-------+----------------+--------------+------------+
| TABLE_ID | INDEX_ID | DB_NAME | TABLE_NAME | INDEX_NAME | REGION_ID | TYPE  | MAX_HOT_DEGREE | REGION_COUNT | FLOW_BYTES |
+----------+----------+---------+------------+------------+-----------+-------+----------------+--------------+------------+
|       48 |     NULL | sbtest  | sbtest27   | NULL       |         5 | write |              4 |            0 |     569174 |
|       59 |     NULL | sbtest  | sbtest26   | NULL       |        92 | write |              4 |            0 |     569174 |
|       84 |     NULL | sbtest  | sbtest9    | NULL       |       140 | write |              4 |            0 |     569174 |
+----------+----------+---------+------------+------------+-----------+-------+----------------+--------------+------------+
3 rows in set (0.02 sec)


{
 "read": [],
 "write": [
  {
   "region_id": 160,
   "region_metric": {
    "flow_bytes": 624177,
    "max_hot_degree": 3,
    "region_count": 0
   },
   "db_name": "sbtest",
   "table_name": "sbtest28",
   "table_id": 46,
   "index_name": "",
   "index_id": 0
  },
  {
   "region_id": 156,
   "region_metric": {
    "flow_bytes": 624177,
    "max_hot_degree": 3,
    "region_count": 0
   },
   "db_name": "sbtest",
   "table_name": "sbtest32",
   "table_id": 54,
   "index_name": "",
   "index_id": 0
  },
  {
   "region_id": 136,
   "region_metric": {
    "flow_bytes": 624177,
    "max_hot_degree": 3,
    "region_count": 0
   },
   "db_name": "sbtest",
   "table_name": "sbtest18",
   "table_id": 62,
   "index_name": "",
   "index_id": 0
  },
....

Code changes

  • N/A

Side effects

  • N/A

Related changes

  • Need to cherry-pick to the release 3.0

This change is Reviewable

@lysu
Copy link
Contributor Author

lysu commented Jun 28, 2019

/run-all-tests

@codecov
Copy link

codecov bot commented Jul 2, 2019

Codecov Report

Merging #10982 into master will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #10982   +/-   ##
===========================================
  Coverage   81.2626%   81.2626%           
===========================================
  Files           423        423           
  Lines         90781      90781           
===========================================
  Hits          73771      73771           
  Misses        11705      11705           
  Partials       5305       5305

Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@imtbkcat
Copy link

imtbkcat commented Jul 5, 2019

/run-all-tests

@imtbkcat
Copy link

imtbkcat commented Jul 8, 2019

/run-all-tests

@imtbkcat
Copy link

imtbkcat commented Jul 8, 2019

/run-unit-test

@imtbkcat
Copy link

imtbkcat commented Jul 8, 2019

@lysu please fix test

@lysu lysu added the status/LGT1 Indicates that a PR has LGTM 1. label Jul 10, 2019
@lysu
Copy link
Contributor Author

lysu commented Jul 10, 2019

/run-all-tests

@lysu
Copy link
Contributor Author

lysu commented Jul 10, 2019

/run-unit-test

1 similar comment
@lysu
Copy link
Contributor Author

lysu commented Jul 10, 2019

/run-unit-test

@lysu
Copy link
Contributor Author

lysu commented Jul 10, 2019

/run-all-tests

@lysu
Copy link
Contributor Author

lysu commented Jul 10, 2019

@imtbkcat PTAL again thx~

@lysu
Copy link
Contributor Author

lysu commented Jul 11, 2019

/run-all-tests

@lysu
Copy link
Contributor Author

lysu commented Jul 11, 2019

/run-unit-test

@lysu
Copy link
Contributor Author

lysu commented Jul 11, 2019

/run-all-tests

@lysu
Copy link
Contributor Author

lysu commented Jul 11, 2019

/rebuild

Copy link

@imtbkcat imtbkcat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lysu lysu merged commit 5664dd2 into pingcap:master Jul 11, 2019
@lysu lysu deleted the dev-region-id-in-hot-tbl-idx branch July 11, 2019 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants