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

executor: locks key in point get executor for pessimistic transaction #10972

Merged
merged 2 commits into from
Jun 28, 2019

Conversation

coocood
Copy link
Member

@coocood coocood commented Jun 27, 2019

What problem does this PR solve?

When a pessimistic transaction uses a primary key or unique key to lock read or update/delete a row, if the result is empty, the key will not be locked, the next insert may return duplicated key error.

What is changed and how it works?

Locks the key in point get plan, even if the value is empty.
It prevents phantom read if the read is a point get.

Check List

Tests

  • Unit test

Code changes

Related changes

  • Need to cherry-pick to the release branch

@coocood coocood requested a review from tiancaiamao June 27, 2019 13:05
@coocood
Copy link
Member Author

coocood commented Jun 27, 2019

/run-all-tests

@coocood
Copy link
Member Author

coocood commented Jun 28, 2019

/run-unit-test

@codecov
Copy link

codecov bot commented Jun 28, 2019

Codecov Report

Merging #10972 into master will decrease coverage by 0.062%.
The diff coverage is 84%.

@@               Coverage Diff                @@
##             master     #10972        +/-   ##
================================================
- Coverage   80.9745%   80.9125%   -0.0621%     
================================================
  Files           418        418                
  Lines         89412      89221       -191     
================================================
- Hits          72401      72191       -210     
- Misses        11783      11795        +12     
- Partials       5228       5235         +7

@tiancaiamao
Copy link
Contributor

LGTM

@tiancaiamao tiancaiamao added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 28, 2019
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants