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
partition: reorganized the execution order of partition table update operators #52442
Conversation
Hi @Defined2014. 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. |
@@ -355,15 +354,6 @@ func (c *index) Create(sctx table.MutateContext, txn kv.Transaction, indexedValu | |||
} | |||
continue | |||
} | |||
if c.idxInfo.Global && len(value) != 0 && !bytes.Equal(value, idxVal) { |
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.
Added by #42311. After change the update operators, no need this code anymore.
/retest |
@Defined2014: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
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. |
memBuffer.Cleanup(sh) | ||
} | ||
}() | ||
|
||
err = t.GetPartition(from).RemoveRecord(ctx, h, currData) |
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.
As updateRecord
, remove record first.
@Defined2014 I assume this will also close #49998 ? |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #52442 +/- ##
================================================
+ Coverage 72.2286% 74.7752% +2.5465%
================================================
Files 1467 1467
Lines 426789 431049 +4260
================================================
+ Hits 308264 322318 +14054
+ Misses 99427 88735 -10692
- Partials 19098 19996 +898
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@Defined2014: 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/test-infra repository. I understand the commands that are listed here. |
/retest |
@Defined2014: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
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. |
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
Yes, linked. |
// The old and new data locate in different partitions. | ||
// Remove record from old partition and add record to new partition. | ||
if from != to { | ||
_, err = t.GetPartition(to).AddRecord(ctx, newData) |
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 the old code does not get duplicate key error in this AddRecord operation?
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.
Because the deleted code https://github.com/pingcap/tidb/pull/52442/files#r1557015648
[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.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mjonss, tiancaiamao, zimulala 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 |
…operators (pingcap#52442) close pingcap#49998, close pingcap#52380
What problem does this PR solve?
Issue Number: close #52380, close #49998
Problem Summary: As
updateRecord
, we should remove record first and usememBuffer.Staging()
to restore it when we meet errors in add records.Ref code link
tidb/pkg/executor/write.go
Lines 165 to 195 in 510f44f
What changed and how does it work?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.