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

executor: support show table partition regions (#17229) #17294

Merged
merged 5 commits into from
May 22, 2020

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented May 19, 2020

cherry-pick #17229 to release-4.0


Signed-off-by: crazycs520 crazycs520@gmail.com

What problem does this PR solve?

related parser PR pingcap/parser#855

As the title said, here is an example:

mysql>show table t partition (p4) regions;
+-----------+----------------+----------------+-----------+-----------------+-------+------------+---------------+------------+----------------------+------------------+
| REGION_ID | START_KEY      | END_KEY        | LEADER_ID | LEADER_STORE_ID | PEERS | SCATTERING | WRITTEN_BYTES | READ_BYTES | APPROXIMATE_SIZE(MB) | APPROXIMATE_KEYS |
+-----------+----------------+----------------+-----------+-----------------+-------+------------+---------------+------------+----------------------+------------------+
| 1047      | t_154_r        | t_154_r_200000 | 1048      | 1               | 1048  | 0          | 0             | 0          | 1                    | 1                |
| 1049      | t_154_r_200000 | t_154_r_400000 | 1050      | 1               | 1050  | 0          | 0             | 0          | 1                    | 0                |
| 1051      | t_154_r_400000 | t_154_r_600000 | 1052      | 1               | 1052  | 0          | 0             | 0          | 1                    | 0                |
| 1053      | t_154_r_600000 | t_154_r_800000 | 1054      | 1               | 1054  | 0          | 0             | 0          | 1                    | 0                |
| 2         | t_154_r_800000 |                | 3         | 1               | 3     | 0          | 747           | 0          | 1                    | 0                |
| 1045      | t_154_         | t_154_r        | 1046      | 1               | 1046  | 0          | 0             | 0          | 1                    | 1                |
+-----------+----------------+----------------+-----------+-----------------+-------+------------+---------------+------------+----------------------+------------------+
6 rows in set
Time: 0.009s
mysql>show table t partition (p3) regions;
+-----------+-----------+---------+-----------+-----------------+-------+------------+---------------+------------+----------------------+------------------+
| REGION_ID | START_KEY | END_KEY | LEADER_ID | LEADER_STORE_ID | PEERS | SCATTERING | WRITTEN_BYTES | READ_BYTES | APPROXIMATE_SIZE(MB) | APPROXIMATE_KEYS |
+-----------+-----------+---------+-----------+-----------------+-------+------------+---------------+------------+----------------------+------------------+
| 1041      | t_153_    | t_154_  | 1042      | 1               | 1042  | 0          | 0             | 0          | 1                    | 0                |
+-----------+-----------+---------+-----------+-----------------+-------+------------+---------------+------------+----------------------+------------------+
1 row in set

What is changed and how it works?

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test

Side effects

Release note

  • support show table partition regions.

Signed-off-by: sre-bot <sre-bot@pingcap.com>
@sre-bot sre-bot requested a review from a team as a code owner May 19, 2020 11:45
@sre-bot
Copy link
Contributor Author

sre-bot commented May 19, 2020

/run-all-tests

Copy link
Contributor

@djshow832 djshow832 left a comment

Choose a reason for hiding this comment

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

Is it necessary to cherry-pick to 4.0 now?

go.mod Outdated
@@ -30,7 +30,11 @@ require (
github.com/pingcap/goleveldb v0.0.0-20191226122134-f82aafb29989
github.com/pingcap/kvproto v0.0.0-20200428135407-0f5ffe459677
github.com/pingcap/log v0.0.0-20200117041106-d28c14d3b1cd
<<<<<<< HEAD
Copy link
Contributor

Choose a reason for hiding this comment

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

Please resolve conflicts

@tiancaiamao
Copy link
Contributor

Is it necessary to cherry-pick to 4.0 now?

I think so

@XuHuaiyu XuHuaiyu added the priority/release-blocker This issue blocks a release. Please solve it ASAP. label May 20, 2020
@crazycs520
Copy link
Contributor

Please merge parser first, @tiancaiamao @XuHuaiyu PTAL

@XuHuaiyu
Copy link
Contributor

@crazycs520 Please update go.mod

@crazycs520
Copy link
Contributor

/run-all-tests

@jebter
Copy link

jebter commented May 22, 2020

/run-all-tests

Copy link
Contributor

@djshow832 djshow832 left a comment

Choose a reason for hiding this comment

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

LGTM

@djshow832 djshow832 added the status/LGT1 Indicates that a PR has LGTM 1. label May 22, 2020
@XuHuaiyu
Copy link
Contributor

/run-unit-test

Copy link
Member

@bb7133 bb7133 left a comment

Choose a reason for hiding this comment

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

LGTM

@XuHuaiyu
Copy link
Contributor

@jebter can merge

@jebter
Copy link

jebter commented May 22, 2020

/merge

@sre-bot sre-bot added the status/can-merge Indicates a PR has been approved by a committer. label May 22, 2020
@sre-bot
Copy link
Contributor Author

sre-bot commented May 22, 2020

/run-all-tests

@sre-bot sre-bot merged commit e0e32e1 into pingcap:release-4.0 May 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/release-blocker This issue blocks a release. Please solve it ASAP. sig/execution SIG execution status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1. type/usability type/4.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants