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 ddl job error count limit, exceed the limit should cancel the ddl job #9295

Merged
merged 14 commits into from
Feb 27, 2019

Conversation

crazycs520
Copy link
Contributor

What problem does this PR solve?

Add DDL job error count limit, if do job error count exceed the limit, and the job is cancelable, then cancel the DDL job to avoid falling into an infinite loop.

What is changed and how it works?

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change

Side effects

Related changes

  • Need to cherry-pick to the release branch

@crazycs520
Copy link
Contributor Author

/run-all-tests

@crazycs520
Copy link
Contributor Author

@zimulala @winkyao @ciscoxll PTAL

ddl/ddl_worker.go Outdated Show resolved Hide resolved
@codecov-io
Copy link

codecov-io commented Feb 13, 2019

Codecov Report

Merging #9295 into master will decrease coverage by <.01%.
The diff coverage is 37.03%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #9295      +/-   ##
=========================================
- Coverage    67.4%   67.4%   -0.01%     
=========================================
  Files         373     373              
  Lines       78544   78564      +20     
=========================================
+ Hits        52946   52956      +10     
- Misses      20838   20847       +9     
- Partials     4760    4761       +1
Impacted Files Coverage Δ
sessionctx/variable/sysvar.go 100% <ø> (ø) ⬆️
ddl/table.go 60.47% <ø> (ø) ⬆️
session/session.go 72.48% <ø> (ø) ⬆️
sessionctx/variable/session.go 30.25% <0%> (-0.2%) ⬇️
sessionctx/variable/varsutil.go 25.45% <0%> (-0.48%) ⬇️
util/admin/admin.go 67.07% <28.57%> (-0.25%) ⬇️
ddl/ddl_worker.go 87.65% <66.66%> (-0.65%) ⬇️
expression/schema.go 94.53% <0%> (+0.78%) ⬆️
store/tikv/lock_resolver.go 42.65% <0%> (+0.94%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 839772b...baf56f8. Read the comment docs.

@crazycs520
Copy link
Contributor Author

/run-all-tests

ddl/ddl_worker.go Outdated Show resolved Hide resolved
Copy link
Contributor

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

@xiekeyi98 xiekeyi98 left a comment

Choose a reason for hiding this comment

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

LGTM

@xiekeyi98 xiekeyi98 added the status/LGT2 Indicates that a PR has LGTM 2. label Feb 19, 2019
}
}
return nil
return true
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems some DDL jobs don't support rollback, and the function returns true. Do we need to wait for other DDL jobs support rollback?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mostly ddl rollback is supported.

@zimulala
Copy link
Contributor

Please address comments.

@crazycs520
Copy link
Contributor Author

/run-all-tests

ddl/ddl_worker.go Outdated Show resolved Hide resolved
@crazycs520
Copy link
Contributor Author

/run-all-tests

Copy link
Contributor

@zimulala zimulala 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 crazycs520 merged commit 4449eb0 into pingcap:master Feb 27, 2019
@you06 you06 added the sig/sql-infra SIG: SQL Infra label Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/sql-infra SIG: SQL Infra status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants