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

store/tikv: fix duplicated lock keys caused data inconsistency. (#16752) #16769

Merged
merged 3 commits into from
Apr 23, 2020

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented Apr 23, 2020

cherry-pick #16752 to release-4.0


What problem does this PR solve?

Problem Summary:

  • Update MultipleTable field is not correct, adding SelectLock operator for multiple table update causes LockKeys contains duplicated keys.

  • When LockKeys contains duplicated keys, the transaction may overwrite Put operation with Lock operation, cause admin check table failure.

What is changed and how it works?

What's Changed:

  • Check update single table by TableRefs.Right == nil
  • Deduplicate keys in LockKeys method.

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test

Side effects

  • Performance regression
    • Consumes more CPU

Release note

fix duplicated lock keys caused data inconsistency.

Signed-off-by: sre-bot <sre-bot@pingcap.com>
@sre-bot sre-bot requested a review from a team as a code owner April 23, 2020 10:48
@sre-bot
Copy link
Contributor Author

sre-bot commented Apr 23, 2020

/run-all-tests

@sre-bot sre-bot added sig/transaction SIG:Transaction priority/release-blocker This issue blocks a release. Please solve it ASAP. type/4.0-cherry-pick type/bugfix This PR fixes a bug. labels Apr 23, 2020
@ghost ghost requested a review from lzmhhh123 April 23, 2020 10:48
@sre-bot sre-bot added this to the v4.0.0-rc.1 milestone Apr 23, 2020
@coocood
Copy link
Member

coocood commented Apr 23, 2020

LGTM

Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

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

LGTM

@jackysp
Copy link
Member

jackysp commented Apr 23, 2020

/merge

@sre-bot sre-bot added the status/can-merge Indicates a PR has been approved by a committer. label Apr 23, 2020
@sre-bot
Copy link
Contributor Author

sre-bot commented Apr 23, 2020

/run-all-tests

@sre-bot
Copy link
Contributor Author

sre-bot commented Apr 23, 2020

@sre-bot merge failed.

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 zz-jason added the status/LGT2 Indicates that a PR has LGTM 2. label Apr 23, 2020
@zz-jason
Copy link
Member

/run-integration-copr-test
/run-unit-test

@zz-jason zz-jason merged commit d9919fb into pingcap:release-4.0 Apr 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/release-blocker This issue blocks a release. Please solve it ASAP. sig/transaction SIG:Transaction status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug. type/4.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants