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: mutex snapshot with txn #25468

Merged
merged 6 commits into from
Jun 16, 2021
Merged

executor: mutex snapshot with txn #25468

merged 6 commits into from
Jun 16, 2021

Conversation

xhebox
Copy link
Contributor

@xhebox xhebox commented Jun 16, 2021

Signed-off-by: xhe xw897002528@gmail.com

What problem does this PR solve?

Problem Summary: Should not be able to set tidb_snapshot and txn_read_ts in the txn. And start txn as of should set tidb_snapshot into 0 as set txn as of.

Check List

Tests

  • Unit test
  • Integration test

Release note

  • Forbid history read and changing stale transaction characteristics in the transaction. And stale transaction will reset tidb_snapshot into 0.

Signed-off-by: xhe <xw897002528@gmail.com>
@xhebox xhebox requested review from nolouch and Yisaer June 16, 2021 04:09
@xhebox xhebox requested a review from a team as a code owner June 16, 2021 04:09
@xhebox xhebox requested review from qw4990 and removed request for a team June 16, 2021 04:09
@ti-chi-bot ti-chi-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 16, 2021
@github-actions github-actions bot added the sig/execution SIG execution label Jun 16, 2021
@xhebox xhebox removed the request for review from qw4990 June 16, 2021 04:10
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Copy link
Contributor

@Yisaer Yisaer left a comment

Choose a reason for hiding this comment

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

Rest LGTM

Comment on lines 314 to 316
// test start txn will flush/mutex tidb_snapshot
tk.MustExec(`set @@tidb_snapshot="2020-10-08 16:45:26";`)
c.Assert(tk.Se.GetSessionVars().SnapshotTS, Equals, uint64(419993151340544000))
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can set tidb_snapshot/ set transaction read only as of timestamp / start transaction read only as of timestamp with different timestamp ( ddl operation between each timestamp) and assert the SchemaVersion of SnapshotInfoSchema.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What about now?

Signed-off-by: xhe <xw897002528@gmail.com>
@ti-chi-bot ti-chi-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 16, 2021
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 16, 2021
Signed-off-by: xhe <xw897002528@gmail.com>
@nolouch nolouch removed the sig/execution SIG execution label Jun 16, 2021
Copy link
Member

@nolouch nolouch left a comment

Choose a reason for hiding this comment

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

lgtm

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • Yisaer
  • nolouch

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 16, 2021
@nolouch
Copy link
Member

nolouch commented Jun 16, 2021

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 9e2cf64

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 16, 2021
@ti-chi-bot ti-chi-bot merged commit 3c97912 into pingcap:master Jun 16, 2021
@nolouch
Copy link
Member

nolouch commented Jun 17, 2021

/run-cherry-pick

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 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.

4 participants