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, executor: add stale read compatibility for temporary table #25206

Merged
merged 10 commits into from
Jun 7, 2021

Conversation

lcwangchao
Copy link
Collaborator

@lcwangchao lcwangchao commented Jun 7, 2021

What problem does this PR solve?

Temporary table should not perform stale read

What is changed and how it works?

Add member variable ExplicitStaleness to builder to mark if this query statement should use stale read explicitly. If the txn is staleness or query is marked staleness, temporary table read should be fail.

Related changes

N/A

Check List

Tests

  • Unit test

Side effects

N/A

Release note

  • No release note

@lcwangchao lcwangchao requested review from a team as code owners June 7, 2021 08:07
@lcwangchao lcwangchao requested review from qw4990 and removed request for a team June 7, 2021 08:07
@ti-chi-bot ti-chi-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 7, 2021
@ti-srebot
Copy link
Contributor

1 similar comment
@ti-srebot
Copy link
Contributor

@github-actions github-actions bot added the sig/execution SIG execution label Jun 7, 2021
@lcwangchao
Copy link
Collaborator Author

/run-check_dev_2

@ti-chi-bot
Copy link
Member

@djshow832: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments.

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@djshow832 djshow832 requested review from tiancaiamao and xhebox and removed request for qw4990 June 7, 2021 09:30
@djshow832 djshow832 added the sig/sql-infra SIG: SQL Infra label Jun 7, 2021
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 7, 2021
Copy link
Contributor

@xhebox xhebox left a comment

Choose a reason for hiding this comment

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

What about IsStaleness instead of ExplicitStaleness? I am OK to ExplicitStaleness, though. Will approve anyway after the response.

@djshow832 djshow832 mentioned this pull request Jun 7, 2021
89 tasks
@lcwangchao
Copy link
Collaborator Author

lcwangchao commented Jun 7, 2021

What about IsStaleness instead of ExplicitStaleness? I am OK to ExplicitStaleness, though. Will approve anyway after the response.

@xhebox The word Explicit means that it uses stale read explicitly in the query statement. So ExplicitStaleness can be a false value when we just use START TRANSACTION READ ONLY AS OF TIMESTAMP... which is still a stale read. I think it may be a bit more clear to indicate what the variable means.

@xhebox
Copy link
Contributor

xhebox commented Jun 7, 2021

@icditwang But it will be true in the next begin or select * .. without as of.

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • djshow832
  • xhebox

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jun 7, 2021
@xhebox
Copy link
Contributor

xhebox commented Jun 7, 2021

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 4bfdcdc

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 7, 2021
@ti-chi-bot ti-chi-bot merged commit 8112537 into pingcap:master Jun 7, 2021
@lcwangchao lcwangchao deleted the temporary_table_stale_read branch June 7, 2021 13:24
@nolouch
Copy link
Member

nolouch commented Jun 8, 2021

Does it need to pick to 5.1?

ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Jun 28, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-5.1 in PR #25786

@djshow832
Copy link
Contributor

Does it need to pick to 5.1?

The temporary table is not GA in 5.1, it will be GA in 5.1.1. We are cherry-picking it to release-5.1. @nolouch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-5.1 sig/execution SIG execution sig/sql-infra SIG: SQL Infra size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants