-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
ddl: get latest old table ID before replace view (#53720) #53774
ddl: get latest old table ID before replace view (#53720) #53774
Conversation
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
please fix the conflict @tangenta |
/retest |
/approve |
/retest |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release-6.5 #53774 +/- ##
================================================
Coverage ? 73.6380%
================================================
Files ? 1096
Lines ? 352117
Branches ? 0
================================================
Hits ? 259292
Misses ? 76156
Partials ? 16669 |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tangenta, wjhuang2016 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
This is an automated cherry-pick of #53720
What problem does this PR solve?
Issue Number: close #53673
Problem Summary:
When we specify
OR REPLACE
clause inCREATE VIEW
statements, if there is an old view, it will be dropped first. However, this old view ID comes from DDL job arguments:tidb/pkg/ddl/table.go
Line 311 in 35e09a2
If there are many concurrent
CREATE VIEW
DDL jobs summiting to the queue, the old view ID maybe outdated. Then we will encounter 'table doesn't exist' error:tidb/pkg/ddl/table.go
Lines 341 to 344 in 35e09a2
What changed and how does it work?
Discard the old view ID from DDL job arguments. Always get the latest old view ID.
Check List
Tests
Run the script mentioned in issue, and
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.