Skip to content
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

executor: do not use batchChecker in 'insert ignore into ...' #12122

Merged
merged 5 commits into from
Sep 10, 2019

Conversation

tiancaiamao
Copy link
Contributor

@tiancaiamao tiancaiamao commented Sep 10, 2019

What problem does this PR solve?

Continue with #12108, please review this PR after it's merged.

After this commit, the insert operations do not use the batchChecker anymore.

What is changed and how it works?

Refactoring code.
Implement the 'insert ignore into ...' operation without the batchChecker

Check List

Tests

  • No code

Release note

  • Write release note for bug-fix or new feature.

batchChecker is difficult to maintain, we should get rid of it.
In this commit I catch the BatchGet result into the snapshot, in this way we can
achieve the same goal as the batchChecker
@tiancaiamao tiancaiamao added sig/execution SIG execution type/enhancement The issue or PR belongs to an enhancement. labels Sep 10, 2019
@tiancaiamao tiancaiamao requested review from lysu and jackysp and removed request for lysu September 10, 2019 07:39
@jackysp
Copy link
Member

jackysp commented Sep 10, 2019

Please resolve the conflicts.

@codecov
Copy link

codecov bot commented Sep 10, 2019

Codecov Report

Merging #12122 into master will increase coverage by 0.1262%.
The diff coverage is n/a.

@@               Coverage Diff               @@
##            master     #12122        +/-   ##
===============================================
+ Coverage   81.382%   81.5083%   +0.1262%     
===============================================
  Files          450        449         -1     
  Lines        96767      97390       +623     
===============================================
+ Hits         78751      79381       +630     
+ Misses       12392      12385         -7     
  Partials      5624       5624

@tiancaiamao
Copy link
Contributor Author

/run-all-tests

Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@lysu lysu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -149,9 +149,9 @@ func prefetchDataCache(ctx context.Context, txn kv.Transaction, rows []toBeCheck
return prefetchConflictedOldRows(ctx, txn, rows, values)
}

// updateDupRowNew updates a duplicate row to a new row.
func (e *InsertExec) updateDupRowNew(ctx context.Context, txn kv.Transaction, row toBeCheckedRow, handle int64, onDuplicate []*expression.Assignment) error {
oldRow, err := e.getOldRowNew(ctx, e.ctx, txn, row.t, handle, e.GenExprs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so batchChecker) getOldRowNew can be remove now~?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not now, the replace ... is still using it.
I'll remove it later...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

func (b *batchChecker) getOldRowNew(ctx context.Context, sctx sessionctx.Context, txn kv.Transaction, t table.Table, handle int64,
this method can not find any usage :D

@lysu lysu added status/all tests passed status/LGT2 Indicates that a PR has LGTM 2. labels Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution status/LGT2 Indicates that a PR has LGTM 2. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants