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

ddl: add index progress metric #14055

Merged
merged 23 commits into from
Dec 20, 2019

Conversation

crazycs520
Copy link
Contributor

@crazycs520 crazycs520 commented Dec 13, 2019

What problem does this PR solve?

image

It indicates the progress of the current add index job. Since we not support concurrently add multi-index jobs now, it will be ok now.

The add index progress = (added row count) / (total row count) *100.

To avoid use select count(*) to get the total count of the table, It use the table count from statistics, It doesn't matter since it uses to estimate the progress.

related pr: pingcap/tidb-ansible#1064

What is changed and how it works?

Check List

Tests

  • No code

Code changes

  • Has exported function/method change

Side effects

Related changes

  • Need to cherry-pick to the release branch

Release note

  • Add index progress metric

@crazycs520 crazycs520 requested a review from a team as a code owner December 13, 2019 11:50
@ghost ghost requested review from eurekaka and winoros and removed request for a team December 13, 2019 11:50
@@ -69,6 +70,7 @@ type worker struct {
quitCh chan struct{}
wg sync.WaitGroup

statsHandle unsafe.Pointer
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Use domain to get statsHandle will have a circle import problem. So stay the statsHandle in DDL worker.

@eurekaka eurekaka removed their request for review December 16, 2019 02:42
@codecov
Copy link

codecov bot commented Dec 16, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@755de18). Click here to learn what that means.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #14055   +/-   ##
===========================================
  Coverage          ?   80.2878%           
===========================================
  Files             ?        483           
  Lines             ?     122209           
  Branches          ?          0           
===========================================
  Hits              ?      98119           
  Misses            ?      16300           
  Partials          ?       7790

@crazycs520
Copy link
Contributor Author

@lamxTyler @AilinKid PTAL

@shenli
Copy link
Member

shenli commented Dec 16, 2019

can we change the progress from [0, 1] to [0, 100]?

@crazycs520
Copy link
Contributor Author

@shenli done. @lamxTyler @AilinKid PTAL

Copy link
Contributor

@alivxxx alivxxx left a comment

Choose a reason for hiding this comment

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

LGTM

@crazycs520
Copy link
Contributor Author

/run-all-tests

Copy link
Contributor

@AilinKid AilinKid left a comment

Choose a reason for hiding this comment

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

LGTM

@AilinKid AilinKid added the require-LGT3 Indicates that the PR requires three LGTM. label Dec 17, 2019
@AilinKid AilinKid added the status/LGT2 Indicates that a PR has LGTM 2. label Dec 17, 2019
@bb7133 bb7133 added status/LGT3 The PR has already had 3 LGTM. and removed status/LGT2 Indicates that a PR has LGTM 2. labels Dec 20, 2019
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

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

sre-bot commented Dec 20, 2019

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Dec 20, 2019

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Dec 20, 2019

@crazycs520 merge failed.

@crazycs520
Copy link
Contributor Author

/run-all-tests

@crazycs520
Copy link
Contributor Author

/run-integration-copr-test

@crazycs520 crazycs520 merged commit 1d60894 into pingcap:master Dec 20, 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
component/metrics require-LGT3 Indicates that the PR requires three LGTM. status/can-merge Indicates a PR has been approved by a committer. status/LGT3 The PR has already had 3 LGTM.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants