Skip to content

sql: remove Txn() from JobExecContext#92320

Merged
craig[bot] merged 2 commits intocockroachdb:masterfrom
stevendanna:remove-jobexec-txn
Nov 23, 2022
Merged

sql: remove Txn() from JobExecContext#92320
craig[bot] merged 2 commits intocockroachdb:masterfrom
stevendanna:remove-jobexec-txn

Conversation

@stevendanna
Copy link
Copy Markdown
Collaborator

@stevendanna stevendanna commented Nov 22, 2022

This removes Txn() from JobExecContext. This method would always
return a nil txn, making it a bit error prone to actually use in
jobs.

Epic: None

Release note: None

@stevendanna stevendanna requested review from a team as code owners November 22, 2022 11:12
@stevendanna stevendanna requested review from HonoreDB and msbutler and removed request for a team November 22, 2022 11:12
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@stevendanna stevendanna changed the title streamingccl: avoid jobExecContext.Txn() sql: remove Txn() from JobExecContext Nov 22, 2022
Comment on lines 105 to 107
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cockroachdb/cdc-prs This bit is worth looking at.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the heads up. I think this is fine since we cache the result anyway, and we just need consistent results while validating, not ones specific to the transaction.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. And, I believe that in the context this was being called, that context would have been nil all of the time anyway. So hopefully this is a noop.

This appears to always be nil. As a method it doesn't really even make
sense, since it is unclear would such a transaction commit.

Release note: None
This removes Txn() from JobExecContext. This method would always
return a nil context, making it a bit error prone to actually use in
jobs.

Release note: None
Copy link
Copy Markdown
Contributor

@adityamaru adityamaru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C2C and backup changes LGTM, but would be nice to get a cdc stamp too.

@stevendanna
Copy link
Copy Markdown
Collaborator Author

bors r=adityamaru

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Nov 23, 2022

Build succeeded:

@craig craig bot merged commit 5ebb4ca into cockroachdb:master Nov 23, 2022
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.

4 participants