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

*: fix bug that write on temporary table send request to TiKV #25535

Merged
merged 5 commits into from
Jun 21, 2021

Conversation

tiancaiamao
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #xxx

Problem Summary:

Write on a temporary table should not send request to TiKV

What is changed and how it works?

What's Changed:

Fix a bug introduced by #24196
I thought remove the temporary KV entries from the transaction buffer could avoid sending request to TiKV.
But I'm wrong. The membuffer.Delete() API causes sending delete keys to TiKV ...

How it Works:

Now I use the transaction SetKVFilter() API to ignore the temporary table KV entries.
See https://github.com/tikv/client-go/blob/b9e4cb538f3028c8a3cdaa6d04d6b47e2dcb322c/tikv/2pc.go#L357

Check List

Tests

  • Unit test

Release note

  • No release note

@tiancaiamao tiancaiamao requested a review from a team as a code owner June 17, 2021 14:03
@tiancaiamao tiancaiamao requested review from lzmhhh123 and removed request for a team June 17, 2021 14:03
@ti-chi-bot ti-chi-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 17, 2021
@tiancaiamao tiancaiamao requested review from coocood and djshow832 and removed request for lzmhhh123 June 17, 2021 14:04
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.

Can you test it manually, on a real cluster?

@github-actions github-actions bot added the sig/execution SIG execution label Jun 17, 2021
@tiancaiamao
Copy link
Contributor Author

Can you test it manually, on a real cluster?

Yes, it's when I testing the feature manually that I found this bug. @djshow832

The test case is now changed to cover writing without network (you can check the failpoint).

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 21, 2021
@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • coocood
  • djshow832

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 21, 2021
@tiancaiamao
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 0dd1714

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 21, 2021
@zhouqiang-cl
Copy link
Contributor

/run-unit-test

@ti-chi-bot ti-chi-bot merged commit 9f18723 into pingcap:master Jun 21, 2021
tiancaiamao added a commit to tiancaiamao/tidb that referenced this pull request Jun 23, 2021
@tiancaiamao tiancaiamao deleted the fix-write-temporary-table branch July 23, 2021 14:20
ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Jul 23, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-5.0 in PR #26516

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

cherry pick to release-5.1 in PR #26519

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/executor needs-cherry-pick-release-5.1 sig/execution SIG execution sig/sql-infra SIG: SQL Infra size/M Denotes a PR that changes 30-99 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