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

sql: remove Txn() from JobExecContext #92320

Merged
merged 2 commits into from
Nov 23, 2022

Conversation

stevendanna
Copy link
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 msbutler and HonoreDB and removed request for a team November 22, 2022 11:12
@cockroach-teamcity
Copy link
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
if execCtx.Txn() != nil {
return execCtx.Txn().ReadTimestamp()
}
Copy link
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
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
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
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
Collaborator Author

bors r=adityamaru

@craig
Copy link
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