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: quickly process the next job after processing the cancelled DDL job #24146

Merged
merged 3 commits into from
Apr 25, 2021

Conversation

zimulala
Copy link
Contributor

@zimulala zimulala commented Apr 20, 2021

What problem does this PR solve?

When the owner and the receiving DDL TiDB are on the same TiDB, quickly process the next job after processing the canceled DDL job.

What is changed and how it works?

  • When the DDL job is "JobStateRollbackDone", we notify the receiving DDL TiDB to process the finished job.

  • Add a log after the DDL JOB fails.

What's Changed:

How it Works:

This optimization also enables faster testing.

Related changes

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

Check List

Tests

  • Manual test (add detailed scripts or steps below)

This optimization also enables faster testing.

Before this PR:
Executing go test takes 196.455s in the DDL package.

After this PR:
Executing go test takes 134.877s in the DDL package.

Release note

  • When the owner and the receiving DDL TiDB are on the same TiDB, quickly process the next job after processing the canceled DDL job.

@zimulala zimulala added type/enhancement The issue or PR belongs to an enhancement. sig/sql-infra SIG: SQL Infra labels Apr 20, 2021
@ti-chi-bot ti-chi-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Apr 20, 2021
@ti-srebot
Copy link
Contributor

@xhebox
Copy link
Contributor

xhebox commented Apr 21, 2021

ddl.go:L576 // If a job is a history job, the state must be JobStateSynced or JobStateRollbackDone or JobStateCancelled.

I believe the behavior is correct.

/lgtm

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Apr 21, 2021
@zimulala
Copy link
Contributor Author

PTAL @AilinKid

@sre-bot
Copy link
Contributor

sre-bot commented Apr 25, 2021

Please follow PR Title Format:

  • pkg [, pkg2, pkg3]: what's changed

Or if the count of mainly changed packages are more than 3, use

  • *: what's changed

@AilinKid
Copy link
Contributor

/lgtm

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • AilinKid
  • xhebox

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 25, 2021
@zimulala
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 31b0193

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Apr 25, 2021
@zimulala
Copy link
Contributor Author

/run-all-test

@ti-chi-bot ti-chi-bot merged commit 6344f7a into pingcap:master Apr 25, 2021
ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Apr 25, 2021
@ti-srebot
Copy link
Contributor

cherry pick to release-5.0 in PR #24254

@zimulala zimulala deleted the zimuxia/rollback-faster branch April 25, 2021 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-5.0 sig/sql-infra SIG: SQL Infra size/XS Denotes a PR that changes 0-9 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/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants