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

Conversation

@lonng
Copy link
Member

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.
Signed-off-by: Lonng <heng@lonng.org>
@codecov

This comment has been minimized.

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
Member

crazycs520 left a comment

Rest LGTM

@crazycs520

This comment has been minimized.

Copy link
Member

crazycs520 commented Nov 27, 2019

/run-all-tests

Copy link
Member

crazycs520 left a comment

LGTM

Copy link
Contributor

djshow832 left a comment

LGTM

@djshow832

This comment has been minimized.

Copy link
Contributor

djshow832 commented Nov 27, 2019

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
@lonng

This comment has been minimized.

Copy link
Member Author

lonng commented Nov 27, 2019

@djshow832 Please approve this PR.

@lonng

This comment has been minimized.

Copy link
Member Author

lonng commented Nov 27, 2019

/merge

@sre-bot

This comment has been minimized.

Copy link

sre-bot commented Nov 27, 2019

/run-all-tests

@sre-bot sre-bot merged commit 80bbc90 into pingcap:master Nov 27, 2019
14 checks passed
14 checks passed
idc-jenkins-ci-tidb/build Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/build_check_race Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/check_dev Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/check_dev_2 Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/common-test job succeeded
Details
idc-jenkins-ci-tidb/integration-common-test Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/integration-compatibility-test Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/integration-copr-test Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/integration-ddl-test Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/mybatis-test job succeeded
Details
idc-jenkins-ci-tidb/sqllogic-test-1 Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/sqllogic-test-2 Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/unit-test Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details
@lonng lonng deleted the lonng:refactor-get-server-info branch Nov 27, 2019
qw4990 added a commit to qw4990/tidb that referenced this pull request Nov 27, 2019
SunRunAway added a commit to SunRunAway/tidb that referenced this pull request Dec 2, 2019
edytagarbarz added a commit to edytagarbarz/tidb that referenced this pull request Dec 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.