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

commented Feb 13, 2019

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 crazycs520 force-pushed the crazycs520:add-ddl-error-limit branch from 3b5a097 to 4948905 Feb 13, 2019

@crazycs520

This comment has been minimized.

Copy link
Contributor Author

commented Feb 13, 2019

/run-all-tests

@crazycs520

This comment has been minimized.

Copy link
Contributor Author

commented Feb 13, 2019

Show resolved Hide resolved ddl/ddl_worker.go Outdated

@crazycs520 crazycs520 force-pushed the crazycs520:add-ddl-error-limit branch from 9552519 to 3050725 Feb 13, 2019

@codecov-io

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Contributor Author

commented Feb 13, 2019

/run-all-tests

Show resolved Hide resolved ddl/ddl_worker.go Outdated

crazycs520 added some commits Feb 14, 2019

Show resolved Hide resolved ddl/ddl_worker.go
@winkyao
Copy link
Member

left a comment

LGTM

@xiekeyi98
Copy link
Contributor

left a comment

LGTM

}
}
return nil
return true

This comment has been minimized.

Copy link
@zimulala

zimulala Feb 19, 2019

Member

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?

This comment has been minimized.

Copy link
@crazycs520

crazycs520 Feb 27, 2019

Author Contributor

Mostly ddl rollback is supported.

@zimulala

This comment has been minimized.

Copy link
Member

commented Feb 26, 2019

Please address comments.

@crazycs520

This comment has been minimized.

Copy link
Contributor Author

commented Feb 27, 2019

/run-all-tests

Show resolved Hide resolved ddl/ddl_worker.go Outdated

crazycs520 added some commits Feb 27, 2019

@crazycs520

This comment has been minimized.

Copy link
Contributor Author

commented Feb 27, 2019

/run-all-tests

@zimulala
Copy link
Member

left a comment

LGTM

@crazycs520 crazycs520 merged commit 4449eb0 into pingcap:master Feb 27, 2019

13 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
idc-jenkins-ci-tidb/build Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/check_dev 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-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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.