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

release-23.2: sql: prevent illegal concurrency with internal executor in some cases #119184

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pkg/sql/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,13 @@ func (ie *InternalExecutor) execInternal(

applyInternalExecutorSessionExceptions(sd)
applyOverrides(sessionDataOverride, sd)
if !rw.async() && (txn != nil && txn.Type() == kv.RootTxn) {
// If the "outer" query uses the RootTxn and the sync result channel is
// requested, then we must disable DistSQL to ensure that the "inner"
// query doesn't use the LeafTxn (which could result in illegal
// concurrency).
sd.DistSQLMode = sessiondatapb.DistSQLOff
}
sd.Internal = true
if sd.User().Undefined() {
return nil, errors.AssertionFailedf("no user specified for internal query")
Expand Down