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

tikv: fix the condition of start ttlManager in prewrite (#18802) #18813

Merged
merged 2 commits into from
Jul 28, 2020

Conversation

ti-srebot
Copy link
Contributor

cherry-pick #18802 to release-4.0


What problem does this PR solve?

Due to the special case for primaryKey in optimistic mode.

tidb/store/tikv/2pc.go

Lines 269 to 276 in bd733c3

if len(c.primaryKey) == 0 {
for i, op := range mutations.ops {
if op != pb.Op_CheckNotExists {
c.primaryKey = mutations.keys[i]
break
}
}
}

The primaryKey may not be the first key of mutations.keys.

What is changed and how it works?

Use batch.isPrimary seems to work correctly.

Check List

Tests

  • Unit test

Release note

  • Fixed an issue that could cause a large transaction to be terminated prematurely.

@ti-srebot
Copy link
Contributor Author

/run-all-tests

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
Copy link
Collaborator

@lysu lysu 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 Jul 28, 2020
Copy link
Member

@jackysp jackysp 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 Jul 28, 2020
@jackysp
Copy link
Member

jackysp commented Jul 28, 2020

/merge

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

/run-all-tests

@ti-srebot
Copy link
Contributor Author

@ti-srebot merge failed.

@jackysp jackysp merged commit 49f88e3 into pingcap:release-4.0 Jul 28, 2020
@bobotu bobotu deleted the release-4.0-b26ea3ab8cac branch July 28, 2020 06:23
@imtbkcat imtbkcat modified the milestones: v4.0.4, v4.0.5 Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. type/bug-fix This PR fixes a bug. type/4.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants