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: support forbiding cross dc read for pointGet #21840

Merged
merged 13 commits into from
Dec 22, 2020

Conversation

Yisaer
Copy link
Contributor

@Yisaer Yisaer commented Dec 16, 2020

What problem does this PR solve?

Issue Number: close #21426

Problem Summary:

What is changed and how it works?

Forbid PointGet read data by holding wrong txnScope.

Check List

Tests

  • Unit test

Release note

  • No release note

@github-actions github-actions bot added the sig/execution SIG execution label Dec 16, 2020
@Yisaer Yisaer marked this pull request as ready for review December 21, 2020 07:43
@Yisaer Yisaer requested a review from a team as a code owner December 21, 2020 07:43
@Yisaer Yisaer requested review from SunRunAway and removed request for a team December 21, 2020 07:43
@Yisaer
Copy link
Contributor Author

Yisaer commented Dec 21, 2020

@winoros @djshow832 PTAL

@@ -2422,7 +2422,7 @@ func (s *session) InitTxnWithStartTS(startTS uint64) error {
}

// no need to get txn from txnFutureCh since txn should init with startTs
txn, err := s.store.BeginWithStartTS(oracle.GlobalTxnScope, startTS)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This would let PointGet always use global as txnScope.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe because PointGet always use max uint64 as start ts, so it doesn't matter.

ddl/placement/utils.go Outdated Show resolved Hide resolved
executor/batch_point_get.go Outdated Show resolved Hide resolved
executor/batch_point_get.go Outdated Show resolved Hide resolved
session/session.go Outdated Show resolved Hide resolved
@Yisaer
Copy link
Contributor Author

Yisaer commented Dec 21, 2020

@djshow832 we will support BatchPointGet later after #21847 is solved.

executor/point_get.go Outdated Show resolved Hide resolved
@djshow832 djshow832 requested a review from winoros December 22, 2020 02:45
Copy link
Contributor

@djshow832 djshow832 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-srebot
Copy link
Contributor

@djshow832, Thanks for your review. The bot only counts LGTMs from Reviewers and higher roles, but you're still welcome to leave your comments. See the corresponding SIG page for more information. Related SIG: execution(slack).

@djshow832 djshow832 added sig/sql-infra SIG: SQL Infra sig/transaction SIG:Transaction labels Dec 22, 2020
Copy link
Contributor

@djshow832 djshow832 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-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 22, 2020
Copy link
Member

@winoros winoros 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-srebot ti-srebot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Dec 22, 2020
@winoros
Copy link
Member

winoros commented Dec 22, 2020

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Dec 22, 2020
@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot ti-srebot merged commit 56d3f6b into pingcap:master Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression sig/execution SIG execution sig/sql-infra SIG: SQL Infra sig/transaction SIG:Transaction 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.

Check partition placement constraints when local transactions read data
4 participants