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: fix nil-pointer error in local retry #111713

Merged
merged 2 commits into from Oct 20, 2023
Merged

Conversation

DrewKimball
Copy link
Collaborator

@DrewKimball DrewKimball commented Oct 4, 2023

tree: return correct parse error for pg_lsn

This patch changes the error returned upon failing to parse a PG_LSN
value to match postgres. Previously, the error was an internal error.

Informs #111327

Release note: None

sql: fix nil-pointer error in local retry

In #105451, we added logic to locally retry a distributed query
after an error. However, the retry logic unconditionally updated a
field of DistSQLReceiver that may be nil, which could cause a
nil-pointer error in some code paths (e.g. apply-join). This patch
adds a check that the field is non-nil, as is done for other places
where it is updated.

There is no release note because the change has not yet made it into
a release.

Fixes #111327

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

:lgtm: Thanks!

Reviewed 2 of 2 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @DrewKimball and @msirek)


-- commits line 14 at r2:
nit: seems like a line is missing here.

Copy link
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

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


-- commits line 23 at r2:
I think you meant #111327 here.

Copy link
Contributor

@msirek msirek 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! 2 of 0 LGTMs obtained (waiting on @DrewKimball)

@mgartner
Copy link
Collaborator

@DrewKimball You still planning on getting this merged? FYI you linked #105451 above, but that's a PR not an issue.

Copy link
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

Yeah, it should be

I think you meant #111327 here.

Reviewable status: :shipit: complete! 2 of 0 LGTMs obtained (waiting on @DrewKimball)

@yuzefovich yuzefovich added the backport-23.2.x Flags PRs that need to be backported to 23.2. label Oct 17, 2023
Copy link
Collaborator Author

@DrewKimball DrewKimball left a comment

Choose a reason for hiding this comment

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

TFTRs! Sorry for the delay.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 2 stale) (waiting on @yuzefovich)


-- commits line 14 at r2:

Previously, yuzefovich (Yahor Yuzefovich) wrote…

nit: seems like a line is missing here.

Done.


-- commits line 23 at r2:

Previously, yuzefovich (Yahor Yuzefovich) wrote…

I think you meant #111327 here.

Done.

@mgartner
Copy link
Collaborator

The commit and PR title still says "Fixes #105451".

Copy link
Collaborator Author

@DrewKimball DrewKimball left a comment

Choose a reason for hiding this comment

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

Sorry for all that, I'm not sure what was wrong before.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 2 stale) (waiting on @yuzefovich)

This patch changes the error returned upon failing to parse a PG_LSN
value to match postgres. Previously, the error was an internal error.

Informs cockroachdb#111327

Release note: None
In cockroachdb#105451, we added logic to locally retry a distributed query
after an error. However, the retry logic unconditionally updated a
field of `DistSQLReceiver` that may be nil, which could cause a
nil-pointer error in some code paths (e.g. apply-join). This patch
adds a check that the field is non-nil, as is done for other places
where it is updated.

There is no release note because the change has not yet made it into
a release.

Fixes cockroachdb#111327

Release note: None
@DrewKimball
Copy link
Collaborator Author

TFTRs!

bors r+

@craig craig bot merged commit 48baa96 into cockroachdb:master Oct 20, 2023
8 checks passed
@craig
Copy link
Contributor

craig bot commented Oct 20, 2023

Build succeeded:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-23.2.x Flags PRs that need to be backported to 23.2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sql/tests: TestRandomSyntaxSQLSmith failed [NPE in applyJoinNode]
5 participants