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

*: Txn() function signature refactor and remove ActivePendingTxn() (#8327) #8567

Merged
merged 2 commits into from
Dec 5, 2018

Conversation

tiancaiamao
Copy link
Contributor

@tiancaiamao tiancaiamao commented Dec 4, 2018

What problem does this PR solve?

Cherry pick from #8327

What is changed and how it works?

I thought #8327 is just a simple refactor, so I did not cherry pick that to release 2.1

But later it turns out that without the commit, release 2.1 will fail on this test #8566

@crazycs520 @winkyao


This change is Reviewable

…ingcap#8327)

* change Txn() function signature to Txn(active bool)
* ActivePendingTxn() is not used any more because Txn() does the work
* change executor builder getStartTS() uint64 to getStartTS() (uint64, error)
@tiancaiamao
Copy link
Contributor Author

/run-all-tests tidb-test=pr/674

@@ -125,7 +125,7 @@ func (e *CheckIndexRangeExec) Open(ctx context.Context) error {

func (e *CheckIndexRangeExec) buildDAGPB() (*tipb.DAGRequest, error) {
dagReq := &tipb.DAGRequest{}
dagReq.StartTs = e.ctx.Txn().StartTS()
dagReq.StartTs = e.ctx.Txn(true).StartTS()
Copy link
Contributor

Choose a reason for hiding this comment

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

should check if sctx.Txn(true).Valid() first?

@tiancaiamao tiancaiamao added the Priority/P1 Features that will be implemented in the latest or next major/minor version label Dec 4, 2018
@pingcap pingcap deleted a comment from crazycs520 Dec 4, 2018
Copy link
Contributor

@winkyao winkyao left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

LGTM

@zz-jason zz-jason added the status/LGT2 Indicates that a PR has LGTM 2. label Dec 5, 2018
@jackysp jackysp merged commit b2382fb into pingcap:release-2.1 Dec 5, 2018
@tiancaiamao tiancaiamao deleted the cherry-2.1-fix-txn branch December 5, 2018 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority/P1 Features that will be implemented in the latest or next major/minor version status/LGT2 Indicates that a PR has LGTM 2. type/bug-fix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants