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
*: LOAD DATA support WITH DETACHED #42159
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Signed-off-by: lance6716 <lance6716@gmail.com>
Signed-off-by: lance6716 <lance6716@gmail.com>
/test build |
executor/builder.go
Outdated
if v.Detached { | ||
if v.FileLocRef == ast.FileLocClient { | ||
b.err = exeerrors.ErrLoadDataCantDetachWithLocal | ||
return nil |
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.
we can move loadDataController out so we use controller.Detached.
we can check this inside controller to make all checks in one place
executor/load_data.go
Outdated
@@ -245,6 +270,7 @@ type LoadDataWorker struct { | |||
progress atomic.Pointer[asyncloaddata.Progress] | |||
getSysSessionFn func() (sessionctx.Context, error) | |||
putSysSessionFn func(context.Context, sessionctx.Context) | |||
ownSession bool |
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.
reuse detached
? always has same value with it
) (err error) { | ||
defer func() { | ||
if e.ownSession { | ||
e.putSysSessionFn(ctx, e.Ctx) |
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 remove e.Ctx
, we're using e.ctx
and e.Ctx
mixingly, it's same as ctx in InsertValues
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.
it's made public for LOAD DATA LOCAL where the clientConn.handleLoadData check Ctx.GetSessionVars().Killed to handle reading packet. Maybe I can unify the CANCEL LOAD DATA JOB with this checking killed in next PR.
} | ||
}() | ||
|
||
s, err := e.getSysSessionFn() |
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 get a new session to execute job related sql?
|
||
defer func() { | ||
ctx2 := context.Background() |
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.
make it work even ctx is cancelled? maybe leave a comment
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.
Signed-off-by: lance6716 <lance6716@gmail.com>
Signed-off-by: lance6716 <lance6716@gmail.com>
@@ -4238,6 +4248,12 @@ func (b *PlanBuilder) buildLoadData(ctx context.Context, ld *ast.LoadDataStmt) ( | |||
if err != nil { | |||
return nil, err | |||
} | |||
|
|||
if detached { |
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 this into buildLoadData
, so no need to init `detached
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.
This is already buildLoadData. You mean buildLoadData (executor)?
executor builder can not change the schema of plan, it's one way
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.
I moved it into buildLoadData (executor) and the query schema is not changed. Maybe other components have already read the old value and decided the query output before build executor.
/hold |
/unhold |
Signed-off-by: lance6716 <lance6716@gmail.com>
This pull request has been accepted and is ready to merge. Commit hash: f92a8b3
|
/test unit-test |
/retest |
/test unit-test |
@lance6716: The specified target(s) for
Use 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. |
/test unit-test |
@lance6716: The specified target(s) for
Use 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. |
/test unit-test |
@lance6716: The specified target(s) for
Use 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. |
/test unit-test |
@lance6716: The specified target(s) for
Use 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. |
/test unit-test |
/retest |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 7752768
|
Signed-off-by: lance6716 <lance6716@gmail.com>
/unhold |
This pull request has been accepted and is ready to merge. Commit hash: 1831183
|
/retest |
What problem does this PR solve?
Issue Number: ref #40499
Problem Summary:
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.