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 the covert job to rollingback job (#23903) #24080

Merged
merged 3 commits into from
Apr 16, 2021

Conversation

ti-srebot
Copy link
Contributor

@ti-srebot ti-srebot commented Apr 16, 2021

cherry-pick #23903 to release-5.0
You can switch your code base to this Pull Request by using git-extras:

# In tidb repo:
git pr https://github.com/pingcap/tidb/pull/24080

After apply modifications, you can push your change to this PR via:

git push [email protected]:ti-srebot/tidb.git pr/24080:release-5.0-4db325d04803

Signed-off-by: AilinKid [email protected]

What problem does this PR solve?

Issue Number: close #23893

Once convertJob2RollbackJob meets error, the job state can't be set as JobStateRollingback since
job state and args may not be correctly overwritten. The job will be fetched to run with the canceling
state again. So we should check the error count here.

What is changed and how it works?

What's Changed:

  1. change all the rollingback assignments to the last step in all ddl canceling logic.
    This is aim to get rid of invalid job state and job args, while the job is assigned with rollingback state, which will lead errors in following rollingback logic, for example, json unmarshal error.

  2. Add error count check and force it be canceled in convertJob2RollbackJob
    This is aim to get rid of the infinite loop of canceling action once convertJob2RollbackJob gets an error.

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Integration test

Release note

  • ddl: fix the covert job to rollingback job

@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot ti-srebot added sig/sql-infra SIG: SQL Infra size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/5.0-cherry-pick labels Apr 16, 2021
@ti-srebot ti-srebot added this to the v5.0.0 ga milestone Apr 16, 2021
@ti-srebot
Copy link
Contributor Author

@AilinKid you're already a collaborator in bot's repo.

@AilinKid
Copy link
Contributor

PTAL @tangenta @crazycs520

Copy link
Contributor

@tangenta tangenta 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 the status/LGT1 Indicates that a PR has LGTM 1. label Apr 16, 2021
@zimulala
Copy link
Contributor

/LGTM

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • tangenta
  • 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. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Apr 16, 2021
@AilinKid
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: c93da0e

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Apr 16, 2021
@zhouqiang-cl zhouqiang-cl added the cherry-pick-approved Cherry pick PR approved by release team. label Apr 16, 2021
@AilinKid
Copy link
Contributor

/merge

@AilinKid
Copy link
Contributor

/merge

2 similar comments
@AilinKid
Copy link
Contributor

/merge

@bb7133
Copy link
Member

bb7133 commented Apr 16, 2021

/merge

@ti-chi-bot ti-chi-bot merged commit c9e2e8f into pingcap:release-5.0 Apr 16, 2021
@zhouqiang-cl zhouqiang-cl modified the milestones: v5.0.0 ga, v5.0.1 Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-approved Cherry pick PR approved by release team. 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. type/5.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants