-
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: fix add index's merge with multi-schema optimization #51747
ddl: fix add index's merge with multi-schema optimization #51747
Conversation
Hi @tangenta. 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/test-infra repository. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #51747 +/- ##
================================================
+ Coverage 70.7663% 72.8020% +2.0356%
================================================
Files 1475 1476 +1
Lines 437315 442228 +4913
================================================
+ Hits 309472 321951 +12479
+ Misses 108511 100117 -8394
- Partials 19332 20160 +828
Flags with carried forward coverage won't be shown. Click here to find out more.
|
} | ||
txn.SetOption(kv.ResourceGroupName, w.jobContext.resourceGroupName) | ||
|
||
tmpIdxRecords, nextKey, taskDone, err := w.fetchTempIndexVals(txn, taskRange) |
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.
Can we move the skip tempIndex or switch this logic
if len(w.currentTempIndexPrefix) == 0 || !bytes.HasPrefix(indexKey, w.currentTempIndexPrefix) { skip, err := w.updateCurrentIndexInfo(indexKey) if err != nil || skip { return skip, err } }
out of fetchTempIndexVals func and do it in taskRange level ?
This could reduce compare and switch prefix logic.
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.
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.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Benjamin2037, 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:
|
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <[email protected]>
What problem does this PR solve?
Issue Number: close #51746
Problem Summary:
The bug is introduced by #47135: when merging temp index records from multiple indexes, I didn't set
reorgInfo
'sStartKey
andEndKey
correctly. As a result, only one temp index get merged.What changed and how does it work?
This PR initializes
reorgInfo.Start
andreorgInfo.End
with keys encoded by the first index ID and the last index ID.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.