-
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: clone table meta for recover table #55443
Conversation
Hi @joechenrh. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. 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-sigs/prow repository. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #55443 +/- ##
================================================
+ Coverage 74.9176% 75.2201% +0.3025%
================================================
Files 1576 1576
Lines 365707 443461 +77754
================================================
+ Hits 273979 333572 +59593
- Misses 71965 89769 +17804
- Partials 19763 20120 +357
Flags with carried forward coverage won't be shown. Click here to find out more.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tangenta, tiancaiamao 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:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why it causes "[schema:1050]Table 't_recover' already exists"
if not clone?
Because recover table will check if it exists table with same name. Lines 1455 to 1458 in 2045418
I have to mention that, on master branch, this test can always pass no matter whether this patch is applied or not. The key problem is that meta data retrieved from infoschema cache will be modified by recover table process, but it seems like recover table doesn't check table state. So this problem is not exposed without infoschema checker. Besides, do you think we should check table state before executing |
/retest |
What problem does this PR solve?
Issue Number: close #55442
Problem Summary:
As described in #55442, the infoschema checker has found inconsistent with v1 and v2 in
TestRecoverTableByJobID
, thus throw a panic.This is because the tableinfo used by recovery is shallow copied from infocache and modified by subsequent process.
tidb/pkg/ddl/executor.go
Lines 1429 to 1444 in c74a233
What changed and how does it work?
Make a clone for table meta. This can fix
TestRecoverTableByJobID
failure.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.