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: revert the optimization for optimistic conflicts pessimistic #11037

Merged
merged 4 commits into from
Jul 3, 2019

Conversation

coocood
Copy link
Member

@coocood coocood commented Jul 2, 2019

What problem does this PR solve?

The previous optimization return WriteConflict error when an optimistic transaction meets a pessimistic lock, this has the problem that optimistic transaction may reach retry limit soon and failed to resolve lock when pessimistic lock ttl is reached.

What is changed and how it works?

Revert the optimization.

Check List

Tests

  • Unit test

Related changes

  • Need to cherry-pick to the release branch

@coocood coocood added component/tikv type/bugfix This PR fixes a bug. labels Jul 2, 2019
@coocood
Copy link
Member Author

coocood commented Jul 2, 2019

@jackysp PTAL

@codecov
Copy link

codecov bot commented Jul 2, 2019

Codecov Report

Merging #11037 into master will decrease coverage by 0.4797%.
The diff coverage is n/a.

@@               Coverage Diff                @@
##             master     #11037        +/-   ##
================================================
- Coverage   81.4157%   80.9359%   -0.4798%     
================================================
  Files           419        419                
  Lines         90598      89304      -1294     
================================================
- Hits          73761      72279      -1482     
- Misses        11644      11786       +142     
- Partials       5193       5239        +46

@coocood
Copy link
Member Author

coocood commented Jul 3, 2019

/run-all-tests

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

@coocood
Copy link
Member Author

coocood commented Jul 3, 2019

/run-common-test

@coocood
Copy link
Member Author

coocood commented Jul 3, 2019

/run-unit-test

@coocood
Copy link
Member Author

coocood commented Jul 3, 2019

/rebuild

syncCh <- struct{}{}
tk.MustQuery("select c from conflict where id = 1").Check(testkit.Rows("3"))

// Check utdated pessimistic lock is resolved.
Copy link
Contributor

Choose a reason for hiding this comment

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

updated

@tiancaiamao
Copy link
Contributor

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/tikv type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants