-
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) #57812
*: Reorg partition fix delete ranges and handling non-clustered tables with concurrent DML (#57114) #57812
Conversation
…s with concurrent DML (pingcap#57114) ref pingcap#45133, close pingcap#56822, close pingcap#57510
919cfb0
to
58b6c31
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release-8.5 #57812 +/- ##
================================================
Coverage ? 57.1070%
================================================
Files ? 1770
Lines ? 627832
Branches ? 0
================================================
Hits ? 358536
Misses ? 245292
Partials ? 24004
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: mjonss, 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 |
/retest |
This is an automated cherry-pick of #57114
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.