-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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: fix duplicate elementID allocation to make sure gc work for partition table #33726
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/9c7b71e43f27cdcc3a1db4a9d56dcb2d8d94ae56 |
@@ -238,12 +239,13 @@ func (dr *delRange) doTask(ctx sessionctx.Context, r util.DelRangeTask) error { | |||
|
|||
// insertJobIntoDeleteRangeTable parses the job into delete-range arguments, | |||
// and inserts a new record into gc_delete_range table. The primary key is | |||
// job ID, so we ignore key conflict error. | |||
// (job ID, element ID), so we ignore key conflict error. |
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.
So the bug exists from day 1 of table partition?
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.
No, it's a long story.
Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-4.0 in PR #33851 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-5.0 in PR #33852 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-5.1 in PR #33853 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-5.2 in PR #33854 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-5.3 in PR #33855 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-5.4 in PR #33856 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-6.0 in PR #33857 |
What problem does this PR solve?
Issue Number: close #33620
Problem Summary:
We use partitionID or indexID as elementID sometimes.
When
drop index for partition table
, we use indexID as elementID. So we may miss some deleteRange.What is changed and how it works?
Allocate elementID as 1, 2, 3, 4 for a DDL job.
Besides, add a comment to log so that we can debug easier.
Check List
Tests
Side effects
Documentation
Release note