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

pd-ctl: support topconfver and topversion #1233

Merged
merged 5 commits into from
Sep 5, 2018

Conversation

rleungx
Copy link
Member

@rleungx rleungx commented Sep 4, 2018

What problem does this PR solve?

Related to #1092.

What is changed and how it works?

This PR provides a way to list top regions whose conf version or version is the largest. After this PR, we can use region topconfver <limit> or region topversion <limit> in pd-ctl to find what we want.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test


topConfVer := &cobra.Command{
Use: "topconfver <limit>",
Short: "show regions with top conf verion",
Copy link
Contributor

Choose a reason for hiding this comment

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

version

mustRegionHeartbeat(c, s.svr, r3)
s.checkTopFlow(c, fmt.Sprintf("%s/regions/writeflow", s.urlPrefix), []uint64{2, 1, 3})
s.checkTopFlow(c, fmt.Sprintf("%s/regions/readflow", s.urlPrefix), []uint64{1, 3, 2})
s.checkTopFlow(c, fmt.Sprintf("%s/regions/writeflow?limit=2", s.urlPrefix), []uint64{2, 1})
s.checkTopFlow(c, fmt.Sprintf("%s/regions/confver", s.urlPrefix), []uint64{3, 2, 1})
Copy link
Contributor

Choose a reason for hiding this comment

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

I suppose you have to change checkTopFlow to another name.

@rleungx
Copy link
Member Author

rleungx commented Sep 5, 2018

PTAL. @nolouch

Copy link
Contributor

@nolouch nolouch left a comment

Choose a reason for hiding this comment

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

LGTM

@disksing disksing merged commit 0d99adc into tikv:master Sep 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants