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 index error #8504

Merged
merged 15 commits into from
Dec 7, 2018
Merged

Conversation

crazycs520
Copy link
Contributor

@crazycs520 crazycs520 commented Nov 29, 2018

What problem does this PR solve?

releate PR #8171
This PR make cancel drop index work correctly. Old tidb version cancel drop index may cause the index states neither on StatePublic nor StateNone. For client, the index is not visible, but client add index with the same name will fail because the name of 'xxx' index is already exists.

What is changed and how it works?

We can only cancel drop index job when the index state is on StatePublic or StateWriteOnly, otherwise, cancel index and make the index state rollback to public may cause data consistency.

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
Copy link
Contributor Author

/run-all-tests

@crazycs520
Copy link
Contributor Author

@winkyao @zimulala @ciscoxll PTAL

@winkyao
Copy link
Contributor

winkyao commented Nov 29, 2018

@crazycs520 Please add proper label.

@crazycs520
Copy link
Contributor Author

/run-all-tests

ddl/index.go Outdated Show resolved Hide resolved
ddl/db_test.go Outdated Show resolved Hide resolved
util/admin/admin.go Outdated Show resolved Hide resolved
@crazycs520
Copy link
Contributor Author

/run-all-tests

ddl/db_test.go Outdated Show resolved Hide resolved
ddl/ddl_api.go Outdated Show resolved Hide resolved
ddl/index.go Outdated Show resolved Hide resolved
planner/core/planbuilder.go Outdated Show resolved Hide resolved
Copy link
Contributor

@winkyao winkyao left a comment

Choose a reason for hiding this comment

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

LGTM

@winkyao winkyao added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 3, 2018
@crazycs520
Copy link
Contributor Author

/run-all-tests

Copy link
Contributor

@ciscoxll ciscoxll left a comment

Choose a reason for hiding this comment

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

LGTM

@ciscoxll ciscoxll added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Dec 5, 2018
util/admin/admin.go Show resolved Hide resolved
ddl/rollingback.go Show resolved Hide resolved
@winkyao
Copy link
Contributor

winkyao commented Dec 7, 2018

@zimulala PTAL

zimulala
zimulala previously approved these changes Dec 7, 2018
Copy link
Contributor

@zimulala zimulala left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@ciscoxll ciscoxll left a comment

Choose a reason for hiding this comment

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

@crazycs520 Please solve the CI error.

@crazycs520
Copy link
Contributor Author

/run-all-tests

@crazycs520 crazycs520 added status/LGT3 The PR has already had 3 LGTM. and removed status/LGT2 Indicates that a PR has LGTM 2. labels Dec 7, 2018
@crazycs520 crazycs520 merged commit 6e2d6c7 into pingcap:master Dec 7, 2018
iamzhoug37 pushed a commit to iamzhoug37/tidb that referenced this pull request Dec 13, 2018
crazycs520 added a commit to crazycs520/tidb that referenced this pull request Feb 27, 2019
crazycs520 added a commit to crazycs520/tidb that referenced this pull request Feb 27, 2019
@you06 you06 added the sig/sql-infra SIG: SQL Infra label Mar 4, 2020
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 status/LGT3 The PR has already had 3 LGTM. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants