-
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
session: improvment refactor the logic of load data batch insert #11132
Conversation
Codecov Report
@@ Coverage Diff @@
## master #11132 +/- ##
==============================================
+ Coverage 81.095% 81.104% +0.0089%
==============================================
Files 420 420
Lines 89622 89638 +16
==============================================
+ Hits 72679 72700 +21
+ Misses 11684 11670 -14
- Partials 5259 5268 +9 |
Codecov Report
@@ Coverage Diff @@
## master #11132 +/- ##
===========================================
Coverage 81.9464% 81.9464%
===========================================
Files 423 423
Lines 93239 93239
===========================================
Hits 76406 76406
Misses 11487 11487
Partials 5346 5346 |
The title is a little long. Please shorten it. |
executor/load_data.go
Outdated
@@ -213,7 +215,7 @@ func (e *LoadDataInfo) getLine(prevData, curData []byte) ([]byte, []byte, bool) | |||
// If it has the rest of data isn't completed the processing, then it returns without completed data. | |||
// If the number of inserted rows reaches the batchRows, then the second return value is true. | |||
// If prevData isn't nil and curData is nil, there are no other data to deal with and the isEOF is true. | |||
func (e *LoadDataInfo) InsertData(prevData, curData []byte) ([]byte, bool, error) { | |||
func (e *LoadDataInfo) InsertData(prevData, curData []byte, txnBatchCheckIns bool) ([]byte, bool, error) { |
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.
maybe better add some comment for txnBatchCheckIns
argument
executor/load_data.go
Outdated
if err != nil { | ||
return nil, reachLimit, err | ||
if !txnBatchCheckIns { | ||
err := e.CheckAndInsertOneBatch() |
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.
after this PR, it seems only unit-test logic will step into here, how about this code snippet and remove txnBatchCheckIns
let it always be true
and modify unit-test to test real check 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.
…en once per transaction
/run-all-tests |
1 similar comment
/run-all-tests |
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
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
…ce per transaction
What problem does this PR solve?
issue 3092
load data batch checked all rows for one packet instead of one transaction, will cause too many batch-get to the storage node.
We could do one batch-get only for one transaction.
local rough tests show that
batch get per transaction may not be always better,
the cost depends on (batchget efficiency with more keys ) and batchget call rt
generally, slower batchget calls result in more load data time cost
What is changed and how it works?
make batchget happens one per transcation but not per packet
Check List
Tests
Code changes
Side effects
Related changes