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

infoschema: fix bug when apply rename table diff #7336

Merged
merged 4 commits into from
Aug 10, 2018

Conversation

alivxxx
Copy link
Contributor

@alivxxx alivxxx commented Aug 9, 2018

What have you changed? (mandatory)

In order to fix the data race in #7318, we copy the DBInfo before write. However, when applying the RenameTable diff for the same schema, we would:

  • First, copy the schema into dbInfo
  • Then, copy the schema into oldDBInfo, drop the table in it, and this would be the final DBInfo in the infomation schema.
  • Last, add the table in dbInfo, although it no longer takes effects.

In order to fix it, we need to not copy the DBInfo twice for the same schema.

What is the type of the changes? (mandatory)

  • Bug fix (non-breaking change which fixes an issue)

How has this PR been tested? (mandatory)

Unit test.

Does this PR affect documentation (docs/docs-cn) update? (mandatory)

No.

Does this PR affect tidb-ansible update? (mandatory)

No.

Does this PR need to be added to the release notes? (mandatory)

No.

Refer to a related PR or issue link (optional)

Benchmark result if necessary (optional)

Add a few positive/negative examples (optional)

PTAL @coocood @zimulala @winoros

@alivxxx alivxxx added the type/bugfix This PR fixes a bug. label Aug 9, 2018
@coocood
Copy link
Member

coocood commented Aug 9, 2018

LGTM

Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

LGTM

@zz-jason
Copy link
Member

/run-all-tests

@zz-jason zz-jason added the status/LGT2 Indicates that a PR has LGTM 2. label Aug 10, 2018
@alivxxx alivxxx merged commit 0d18ac2 into pingcap:master Aug 10, 2018
@alivxxx alivxxx deleted the bugfix branch August 10, 2018 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants