-
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
*: Reorg partition fix delete ranges and handling non-clustered tables with concurrent DML #57114
*: Reorg partition fix delete ranges and handling non-clustered tables with concurrent DML #57114
Conversation
Still some debug and cleanup to do.
Note that TestMultiSchemaDropListColumnsDefaultPartition is failing now! Next step is to investigate this...
pkg/ddl/sanity_check.go
Outdated
panic(fmt.Sprintf("expect delete range count %d, actual count %d", expectedCnt, actualCnt)) | ||
switch job.Type { | ||
case model.ActionReorganizePartition, model.ActionRemovePartitioning, model.ActionAlterTablePartitioning: | ||
if actualCnt < expectedCnt { |
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.
I think modify expectedDeleteRangeCnt is better.
Agree. This is more like a test, it is better to change the test itself instead of the assertion.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Defined2014, tangenta 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:
|
/retest |
4 similar comments
/retest |
/retest |
/retest |
/retest |
@mjonss: The following test failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created to branch |
…s with concurrent DML (pingcap#57114) ref pingcap#45133, close pingcap#56822, close pingcap#57510
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created to branch |
This reverts commit 8e8da6d.
What problem does this PR solve?
Issue Number: close #56822 ref #45133 close #57510
based on #56974.
Problem Summary:
First the DeleteRange did not include the old replaced Global Indexes,
Then I found an issue with non-clustered tables and reorganize partition,
where double written records during StateWriteOnly/StateWriteReorganization would get Duplicate key errors, due to they would generate new _tidb_rowid in the new partition, making it impossible to detect if an index entry came from Backfilling or if it is new, when recreating the indexes.
What changed and how does it work?
Fixed the DeleteRange, by adding a list of TableID+IndexID ranges that should also be cleaned by DeleteRanges.
Instead of first copy all records and then recreate the indexes, I now use AddRecord table interface, and created both the table record as well as all the index entries for that row. Note that AddRecord will also generate a new _tidb_rowid, so that part of the reorg code is removed as well.
Drawbacks are:
Benefits are:
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.