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: check constraint for "Delete-Your-Writes" records when txn commit (#14968) #15176

Merged
merged 4 commits into from
Mar 11, 2020

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented Mar 6, 2020

cherry-pick #14968 to release-3.0


What problem does this PR solve?

in #9127, we push constraint check down to tikv layer when prewrite phase.

but it miss the situation that txn add record a then delete record a, we also need check record is real duplicate when commit.

so just as TestDeferConstraintCheckForDelete, it will lead to "delete wrong data"(primary key) or "inconsist index data"(unique key)

What is changed and how it works?

we can do a addition batch get check for those key before commit just like pre-#9127 logic
but maybe better to follow #9127's idea just check it with prewrite mutation flag.

Check List

Tests

  • Unit test
  • Integration test

Code changes

  • impl change
  • kvproto
  • tikv/unistore

Side effects

  • n/a

Related changes

  • Need to cherry-pick to the release branch 3.0/3.1

Release note

  • fix missing check constraint for "Delete-Your-Writes" records.

This change is Reviewable

Signed-off-by: sre-bot <sre-bot@pingcap.com>
@sre-bot
Copy link
Contributor Author

sre-bot commented Mar 6, 2020

/run-all-tests

@jackysp jackysp added the priority/release-blocker This issue blocks a release. Please solve it ASAP. label Mar 11, 2020
@lysu
Copy link
Contributor

lysu commented Mar 11, 2020

/run-all-tests tikv=pr/7054

Copy link
Contributor

@youjiali1995 youjiali1995 left a comment

Choose a reason for hiding this comment

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

LGTM

@lysu lysu added status/all-tests-passed status/LGT1 Indicates that a PR has LGTM 1. labels Mar 11, 2020
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 Mar 11, 2020

/merge

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

sre-bot commented Mar 11, 2020

/run-all-tests

@sre-bot sre-bot merged commit 3d41a61 into pingcap:release-3.0 Mar 11, 2020
@tiancaiamao tiancaiamao deleted the release-3.0-a37a0ff461d9 branch August 4, 2020 10:48
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/execution SIG execution sig/transaction SIG:Transaction status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants