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

planner: check index valid while forUpdateRead (#22152) #22365

Conversation

ti-srebot
Copy link
Contributor

@ti-srebot ti-srebot commented Jan 12, 2021

cherry-pick #22152 to release-5.0-rc
You can switch your code base to this Pull Request by using git-extras:

# In tidb repo:
git pr 22365

After apply modifications, you can push your change to this PR via:

git push git@github.com:ti-srebot/tidb.git pr/22365:ti-srebot:release-5.0-rc-4088c2011ba7

What problem does this PR solve?

cherry pick #21596 to master as a temporary solution.

Issue Number: close #21498

Problem Summary:

ForUpdateRead will read data using schema version of startTS, this may lead to incorrectness, the cases are listed in #21498

What is changed and how it works?

What's Changed:

For RC and forUpdateRead in RR, check if index's state is still StatePublic.

How it Works:

This check confirms index between snapshotTS and forUpdateTS is not changed, otherwise, the index should not be used.

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test

Side effects

  • Performance regression
    • Consumes more CPU, there is a little regression testing with tpc-c

Release note

  • Fix a bug that schema change will lead to incorrectness when forUpdateRead

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot ti-srebot requested a review from a team as a code owner January 12, 2021 07:10
@ti-srebot ti-srebot requested review from winoros and removed request for a team January 12, 2021 07:10
@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot
Copy link
Contributor Author

@you06 you're already a collaborator in bot's repo.

@cfzjywxk
Copy link
Contributor

5.0-rc will release today maybe we don't need to pick it to release-5.0-rc again.

@jackysp
Copy link
Member

jackysp commented Jan 12, 2021

5.0-rc will release today maybe we don't need to pick it to release-5.0-rc again.

yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/planner SIG: Planner sig/sql-infra SIG: SQL Infra sig/transaction SIG:Transaction type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants