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

infoschema: refactor GetClusterServerInfo to avoid executing internal SQL #13765

Merged
merged 2 commits into from Nov 27, 2019
Merged

infoschema: refactor GetClusterServerInfo to avoid executing internal SQL #13765

merged 2 commits into from Nov 27, 2019

Conversation

lonng
Copy link
Contributor

@lonng lonng commented Nov 27, 2019

Signed-off-by: Lonng heng@lonng.org

What problem does this PR solve?

In the current implementation, we must to execute SELECT type, address, status_address FROM INFORMATION_SCHEMA.TIDB_CLUSTER_INFO ORDER BY type to obtain cluster topology. That's inefficient.

What is changed and how it works?

This PR refactor this part and extras an individual function to obtains cluster topology and make other functions work more easily.

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change

Release note

  • No need.

@codecov
Copy link

codecov bot commented Nov 27, 2019

Codecov Report

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

@@             Coverage Diff             @@
##             master     #13765   +/-   ##
===========================================
  Coverage   80.0626%   80.0626%           
===========================================
  Files           474        474           
  Lines        117107     117107           
===========================================
  Hits          93759      93759           
  Misses        15964      15964           
  Partials       7384       7384

go.mod Show resolved Hide resolved
Copy link
Contributor

@crazycs520 crazycs520 left a comment

Choose a reason for hiding this comment

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

Rest LGTM

@crazycs520
Copy link
Contributor

/run-all-tests

Copy link
Contributor

@crazycs520 crazycs520 left a comment

Choose a reason for hiding this comment

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

LGTM

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
Copy link
Contributor

Change the PR title: inforschema => infoschema, execute => executing.

@lonng lonng changed the title inforschema: refactor GetClusterServerInfo to avoid execute internal SQL infoschema: refactor GetClusterServerInfo to avoid executing internal SQL Nov 27, 2019
@djshow832 djshow832 added the status/LGT2 Indicates that a PR has LGTM 2. label Nov 27, 2019
@lonng
Copy link
Contributor Author

lonng commented Nov 27, 2019

@djshow832 Please approve this PR.

@lonng
Copy link
Contributor Author

lonng commented Nov 27, 2019

/merge

@sre-bot sre-bot added the status/can-merge Indicates a PR has been approved by a committer. label Nov 27, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Nov 27, 2019

/run-all-tests

@sre-bot sre-bot merged commit 80bbc90 into pingcap:master Nov 27, 2019
@lonng lonng deleted the refactor-get-server-info branch November 27, 2019 06:32
qw4990 pushed a commit to qw4990/tidb that referenced this pull request Nov 27, 2019
XiaTianliang pushed a commit to XiaTianliang/tidb that referenced this pull request Dec 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants