-
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
*: isolate more variables for runWithSystemSession
#54791
Conversation
Signed-off-by: lance6716 <[email protected]>
Hi @lance6716. 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-sigs/prow repository. |
pkg/executor/executor.go
Outdated
@@ -1466,6 +1466,11 @@ func init() { | |||
return nil, err | |||
} | |||
|
|||
tm := sessiontxn.GetTxnManager(sctx) | |||
err = tm.EnterNewTxn(ctx, &sessiontxn.EnterNewTxnRequest{}) |
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.
should we commit or rollback before return?
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #54791 +/- ##
=================================================
- Coverage 74.7413% 56.4529% -18.2884%
=================================================
Files 1555 1680 +125
Lines 363372 616377 +253005
=================================================
+ Hits 271589 347963 +76374
- Misses 72138 244974 +172836
- Partials 19645 23440 +3795
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Signed-off-by: lance6716 <[email protected]>
Signed-off-by: lance6716 <[email protected]>
/retest |
@lance6716: 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-sigs/prow repository. |
Signed-off-by: lance6716 <[email protected]>
/check-issue-triage-complete |
runWithSystemSession
runWithSystemSession
runWithSystemSession
@@ -898,6 +897,7 @@ func (e *hugeMemTableRetriever) dataForColumnsInTable(ctx context.Context, sctx | |||
internalCtx := kv.WithInternalSourceType(context.Background(), kv.InternalTxnOthers) | |||
// Build plan is not thread safe, there will be concurrency on sessionctx. | |||
if err := runWithSystemSession(internalCtx, sctx, func(s sessionctx.Context) error { | |||
is := sessiontxn.GetTxnManager(s).GetTxnInfoSchema() |
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.
is this where the fix is, replace with another session 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.
The original error is "ctx provider not found", but it's overwritten #54809. So the first fix is add sessiontxn.NewTxn
.
Then another problem is the system session still uses the is
captured by closure, which has conflict with user session. So moving it here.
@@ -2377,5 +2378,12 @@ func runWithSystemSession(ctx context.Context, sctx sessionctx.Context, fn func( | |||
return err | |||
} | |||
defer b.ReleaseSysSession(ctx, sysCtx) | |||
if err = sessiontxn.NewTxn(ctx, sysCtx); err != 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.
please add some comment on why we must open an explicit txn
/hold |
Signed-off-by: lance6716 <[email protected]>
/unhold |
/retest |
@lance6716: 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-sigs/prow repository. |
/retest |
@lance6716: 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-sigs/prow repository. |
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created to branch |
What problem does this PR solve?
Issue Number: close #54343
Problem Summary:
What changed and how does it work?
as title
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.