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 cancel drop table/database ddl job bug. #8537

Merged
merged 21 commits into from Dec 26, 2018

Conversation

Projects
None yet
4 participants
@crazycs520
Copy link
Contributor

crazycs520 commented Nov 30, 2018

What problem does this PR solve?

related same PR #8171.
This PR fix cancel drop table/database ddl job.
The droped table/database info state is change as follows:
public -> write only -> delete only -> none.

Currently, If we cancel drop table/database ddl in write only and delete only, TiDB infoschema will delete the table and when we operate the corresponding table/database, TiDB will return error: xxx not exist. But if we create table/database with the same name will return err: xxx already exists.

This PR fix above problem, if successfully cancel the drop table/database ddl, we should make TiDB infoschema to reload the table/database.

What is changed and how it works?

Only allow cancel drop database/table before the job first run.

Cancel create table/database will be ok in currentlly, and this pr also add test for this.

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change
    Side effects

  • Increased code complexity

Related changes

  • Need to cherry-pick to the release branch

This change is Reviewable

@crazycs520 crazycs520 force-pushed the crazycs520:cancel-drop-table branch from f375884 to d9b631e Nov 30, 2018

@crazycs520

This comment has been minimized.

Copy link
Contributor Author

crazycs520 commented Dec 1, 2018

/run-all-tests

Show resolved Hide resolved ddl/table.go Outdated
Show resolved Hide resolved ddl/schema.go Outdated
Show resolved Hide resolved ddl/schema.go Outdated
Show resolved Hide resolved ddl/table.go Outdated
Show resolved Hide resolved ddl/schema.go Outdated
Show resolved Hide resolved ddl/table.go Outdated
@winkyao

This comment has been minimized.

Copy link
Member

winkyao commented Dec 6, 2018

@zimulala PTAL

Show resolved Hide resolved ddl/table.go Outdated
Show resolved Hide resolved ddl/table.go Outdated
Show resolved Hide resolved ddl/table.go Outdated
Show resolved Hide resolved ddl/schema.go Outdated
Show resolved Hide resolved ddl/schema.go Outdated
Show resolved Hide resolved ddl/schema.go Outdated
@ciscoxll
Copy link
Contributor

ciscoxll left a comment

Please solve the CI error.

Show resolved Hide resolved ddl/rollingback.go Outdated
@crazycs520

This comment has been minimized.

Copy link
Contributor Author

crazycs520 commented Dec 24, 2018

/run-all-tests

@zimulala
Copy link
Member

zimulala left a comment

LGTM

Show resolved Hide resolved ddl/db_test.go
@ciscoxll
Copy link
Contributor

ciscoxll left a comment

LGTM

@ciscoxll ciscoxll added status/LGT3 and removed status/LGT2 labels Dec 25, 2018

@ciscoxll

This comment has been minimized.

Copy link
Contributor

ciscoxll commented Dec 25, 2018

/run-all-tests

@crazycs520

This comment has been minimized.

Copy link
Contributor Author

crazycs520 commented Dec 25, 2018

/run-unit-test

@crazycs520

This comment has been minimized.

Copy link
Contributor Author

crazycs520 commented Dec 25, 2018

/run-unit-test

2 similar comments
@crazycs520

This comment has been minimized.

Copy link
Contributor Author

crazycs520 commented Dec 25, 2018

/run-unit-test

@crazycs520

This comment has been minimized.

Copy link
Contributor Author

crazycs520 commented Dec 25, 2018

/run-unit-test

@crazycs520

This comment has been minimized.

Copy link
Contributor Author

crazycs520 commented Dec 25, 2018

/rebuild

crazycs520 added some commits Dec 26, 2018

@ciscoxll ciscoxll merged commit ffa375f into pingcap:master Dec 26, 2018

4 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
license/cla Contributor License Agreement is signed.
Details

yu34po added a commit to yu34po/tidb that referenced this pull request Jan 2, 2019

crazycs520 added a commit to crazycs520/tidb that referenced this pull request Feb 28, 2019

crazycs520 added a commit to crazycs520/tidb that referenced this pull request Feb 28, 2019

zz-jason added a commit that referenced this pull request Feb 28, 2019

crazycs520 added a commit to crazycs520/tidb that referenced this pull request Mar 1, 2019

zimulala added a commit that referenced this pull request Mar 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.