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: fix ddl hang over when it meets panic in cancelling path #23204

Merged
merged 18 commits into from
Mar 13, 2021

Conversation

AilinKid
Copy link
Contributor

@AilinKid AilinKid commented Mar 9, 2021

Signed-off-by: ailinkid 314806019@qq.com

What problem does this PR solve?

Issue Number: close #23202

What is changed and how it works?

What's Changed:
record the error count when the goroutine restored from panic.

Check List

Tests

  • Unit test
  • Integration test

Release note

  • fix ddl hang over when it meets panic in cancelling path.

@ti-chi-bot ti-chi-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 9, 2021
@github-actions github-actions bot added the sig/sql-infra SIG: SQL Infra label Mar 9, 2021
@wjhuang2016
Copy link
Member

/lgtm

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 9, 2021
ddl/ddl_worker.go Outdated Show resolved Hide resolved
ddl/index.go Outdated Show resolved Hide resolved
ddl/ddl_worker.go Outdated Show resolved Hide resolved
ddl/column_type_change_test.go Outdated Show resolved Hide resolved
Signed-off-by: ailinkid <314806019@qq.com>
Signed-off-by: ailinkid <314806019@qq.com>
.
Signed-off-by: ailinkid <314806019@qq.com>
Copy link
Contributor

@xhebox xhebox left a comment

Choose a reason for hiding this comment

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

/lgtm

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Mar 11, 2021
@AilinKid
Copy link
Contributor Author

/merge

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 11, 2021
@zimulala zimulala added the require-LGT3 Indicates that the PR requires three LGTM. label Mar 11, 2021
ddl/ddl_worker.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot removed the status/LGT2 Indicates that a PR has LGTM 2. label Mar 11, 2021
ddl/column_type_change_test.go Outdated Show resolved Hide resolved
ddl/column_type_change_test.go Show resolved Hide resolved
.
Signed-off-by: ailinkid <314806019@qq.com>
@ti-chi-bot ti-chi-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed status/can-merge Indicates a PR has been approved by a committer. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 11, 2021
.
Signed-off-by: ailinkid <314806019@qq.com>
// If job is cancelled, we shouldn't return an error and shouldn't load DDL variables.
if job.State == model.JobStateCancelled {
logutil.Logger(w.logCtx).Info("[ddl] DDL job is cancelled normally", zap.Error(err))
err = nil
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 that we should return here directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch

.
Signed-off-by: ailinkid <314806019@qq.com>
@zimulala
Copy link
Contributor

/LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 12, 2021
@xhebox
Copy link
Contributor

xhebox commented Mar 12, 2021

/lgtm

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • xhebox
  • zimulala

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. status/can-merge Indicates a PR has been approved by a committer. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Mar 12, 2021
@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Mar 12, 2021
@AilinKid
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 19abb34

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 13, 2021
@ti-chi-bot ti-chi-bot merged commit 46f5f21 into pingcap:master Mar 13, 2021
ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Mar 13, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #23297

ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Mar 13, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-5.0-rc in PR #23298

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 size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ddl: ddl job will hang on loop when it encounts panic in cancelling logic
7 participants