Skip to content

sql: refactor internal executor factory to accept init function#73193

Closed
adityamaru wants to merge 2 commits intocockroachdb:masterfrom
adityamaru:inject-extra-txn-state
Closed

sql: refactor internal executor factory to accept init function#73193
adityamaru wants to merge 2 commits intocockroachdb:masterfrom
adityamaru:inject-extra-txn-state

Conversation

@adityamaru
Copy link
Copy Markdown
Contributor

This change refactors the InternalExecutorFactory to take in
a closure that allows injecting external state into a new internal
executor.

Release note: None

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

This change refactors the InternalExecutorFactory to take in
a closure that allows injecting external state into a new internal
executor.

Release note: None
@adityamaru adityamaru force-pushed the inject-extra-txn-state branch from c0cac43 to a21f64b Compare November 27, 2021 23:30
In a bid to make the InternalExecutor more tightly bound
with certain conn executor state such as transaction, session
data, extraTxnState (including descs collection), this patch
removes the `InternalExecutor` field from the executor config.
In this way consumers of the IE cannot just run queries off of
this free floating instance of the IE, but instead have to
initialize a new IE in the context of the surrounding txn.

The `InternalExecFactory` currently takes a closure that allows
for injecting necessary state into a newly created IE, but one
could imagine a future where we use typed parameters to force
all users to bind the IE with the surrounding state it is being
used in.

Release note: None
@adityamaru adityamaru force-pushed the inject-extra-txn-state branch from a21f64b to 323561b Compare November 28, 2021 18:57
@adityamaru adityamaru closed this Jan 24, 2022
@adityamaru adityamaru deleted the inject-extra-txn-state branch January 24, 2022 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants