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

planner: logically delete the bindinfo when create the new binding #26015

Merged
merged 19 commits into from
Aug 6, 2021

Conversation

Reminiscent
Copy link
Contributor

@Reminiscent Reminiscent commented Jul 7, 2021

What problem does this PR solve?

Issue Number: close #25842

Problem Summary:
In this PR, we physically delete the bindings when we create a new binding to prevent some problems of inconsistent cache. But this method can not solve all the problems, for example issue#25842. So after we introduce the table lock for mysql.bind_info in this PR, we can revert the origin change.

What is changed and how it works?

What's Changed:
Logically delete the binding when we create a new binding.

  • Need to cherry-pick to the release branch

Check List

Tests

Release note

  • No release note

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jul 7, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • eurekaka
  • rebelice

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 the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 7, 2021
@Reminiscent
Copy link
Contributor Author

/label sig/planner, epic/sql-plan-management, type/bug-fix

@github-actions github-actions bot added the sig/planner SIG: Planner label Jul 7, 2021
bindinfo/bind_test.go Outdated Show resolved Hide resolved
@Reminiscent Reminiscent changed the title planner: logically delete the bindinfo when we create the new binding planner: logically delete the bindinfo when create the new binding Jul 7, 2021
@ichn-hu ichn-hu mentioned this pull request Jul 7, 2021
@Reminiscent
Copy link
Contributor Author

/cc @eurekaka

@ti-chi-bot ti-chi-bot requested a review from eurekaka July 12, 2021 08:48
@github-actions github-actions bot added the sig/sql-infra SIG: SQL Infra label Jul 12, 2021
@zhangjinpeng87
Copy link
Contributor

This small PR lasted for 10 days, please review it in time.

@ti-chi-bot
Copy link
Member

@Reminiscent: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ti-chi-bot ti-chi-bot added the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label Aug 3, 2021
@zhouqiang-cl zhouqiang-cl removed the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label Aug 4, 2021
bindinfo/bind_test.go Outdated Show resolved Hide resolved
bindinfo/bind_test.go Show resolved Hide resolved
bindinfo/handle.go Outdated Show resolved Hide resolved
bindinfo/handle.go Outdated Show resolved Hide resolved
rows = tk.MustQuery("select original_sql, status from mysql.bind_info").Rows()
c.Assert(len(rows), Equals, 2)
c.Assert(rows[0][1], Equals, "deleted")
c.Assert(rows[1][1], Equals, "using")
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the builtin row not returned by this query?

bindinfo/handle.go Outdated Show resolved Hide resolved
bindinfo/bind_test.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 5, 2021
@ti-chi-bot ti-chi-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 5, 2021
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 6, 2021
@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 Aug 6, 2021
@eurekaka
Copy link
Contributor

eurekaka commented Aug 6, 2021

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 2d207da

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Aug 6, 2021
@Reminiscent
Copy link
Contributor Author

/run-all-tests

1 similar comment
@Reminiscent
Copy link
Contributor Author

/run-all-tests

@winoros
Copy link
Member

winoros commented Mar 8, 2022

/run-cherry-picker release-5.0

@winoros
Copy link
Member

winoros commented Mar 8, 2022

/run-cherry-picker release-5.1

@ti-srebot
Copy link
Contributor

cherry pick to release-5.1 in PR #32901

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

cherry pick to release-5.0 in PR #32902

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic/sql-plan-management needs-cherry-pick-release-5.0 needs-cherry-pick-release-5.1 sig/planner SIG: Planner 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.

inconsistent SQL bind caches after recreating bind with different bind_sql for a same original_sql
8 participants