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: harden the check for when leaf txn can used #83299

Merged
merged 1 commit into from
Jun 24, 2022

Conversation

yuzefovich
Copy link
Member

This commit refactors the code where we determine whether we have to
make a leaf txn for the local flow (which is the case when we either
parallelize scans or use the streamer API) to be "stronger". We recently
saw a nil-pointer error when trying to create a streamer (the txn was
nil), and the only case I could see this happening was that if
makeLeaf function returned nil which can occur if the original txn was
nil. I still don't see how that could happen (and neither could
I reproduce it), but this commit makes the code more bullet-proof so
that we ensure that LeafTxnInputState is non-nil when we expect to
have concurrency.

Fixes: #83259.

Release note: None

@yuzefovich yuzefovich requested review from rharding6373, michae2 and a team June 23, 2022 19:26
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@rharding6373 rharding6373 left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @michae2)

This commit refactors the code where we determine whether we have to
make a leaf txn for the local flow (which is the case when we either
parallelize scans or use the streamer API) to be "stronger". We recently
saw a nil-pointer error when trying to create a streamer (the txn was
nil), and the only case I could see this happening was that if
`makeLeaf` function returned nil which can occur if the original txn was
nil. I still don't see how that could happen (and neither could
I reproduce it), but this commit makes the code more bullet-proof so
that we ensure that `LeafTxnInputState` is non-nil when we expect to
have concurrency.

Release note: None
@yuzefovich
Copy link
Member Author

TFTR!

bors r+

@craig
Copy link
Contributor

craig bot commented Jun 24, 2022

Build succeeded:

@craig craig bot merged commit 7af6c0d into cockroachdb:master Jun 24, 2022
@yuzefovich yuzefovich deleted the streamer-txn branch June 24, 2022 02:39
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.

sqlsmith: connection refused after SELECT [INSERT] violates foreign key constraint
3 participants