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

exec: protect against unset syncFlowConsumer #38557

Merged
merged 1 commit into from
Jul 8, 2019
Merged

exec: protect against unset syncFlowConsumer #38557

merged 1 commit into from
Jul 8, 2019

Conversation

asubiotto
Copy link
Contributor

This should never happen since it implies that the receiver isn't
connected correctly. These happen when a node sends a SetupFlow request
to a remote node where the spec specifies that the response is on that
remote node. We don't see panics in the row execution engine due to
wrapping the syncFlowConsumer with a copyingRowReceiver, but this state
can cause setupVectorized to panic.

This commit protects against this state pending further investigation.

Release note: None

This should never happen since it implies that the receiver isn't
connected correctly. These happen when a node sends a SetupFlow request
to a remote node where the spec specifies that the response is on that
remote node. We don't see panics in the row execution engine due to
wrapping the syncFlowConsumer with a copyingRowReceiver, but this state
can cause setupVectorized to panic.

This commit protects against this state pending further investigation.

Release note: None
@asubiotto asubiotto requested review from jordanlewis and a team June 28, 2019 16:09
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@asubiotto
Copy link
Contributor Author

Looks like the ones causing these are internal executor queries:

I190628 15:59:45.676023 3672 sql/distsql_running.go:180  [intExec=adopt-job] error vectorizing remote flow d6d8146f-f896-41d8-8c17-82bae5f1bbd3, restarting with vectorize=off and ID 10d20b4f-490d-48b6-943a-a1bc791f5102: syncFlowConsumer unset, unable to create materializer

Copy link
Member

@jordanlewis jordanlewis left a comment

Choose a reason for hiding this comment

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

:lgtm: but this seems weird for sure.

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


pkg/sql/distsqlrun/column_exec_setup.go, line 1080 at r1 (raw file):

			case distsqlpb.StreamEndpointSpec_SYNC_RESPONSE:
				if f.syncFlowConsumer == nil {
					return errors.New("syncFlowConsumer unset, unable to create materializer")

When would this practically happen? It seems like kind of a weird case. Could this be pointing at an error case we're not catching or something?

@asubiotto asubiotto requested a review from a team July 2, 2019 18:39
Copy link
Contributor Author

@asubiotto asubiotto 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 @jordanlewis)


pkg/sql/distsqlrun/column_exec_setup.go, line 1080 at r1 (raw file):

Previously, jordanlewis (Jordan Lewis) wrote…

When would this practically happen? It seems like kind of a weird case. Could this be pointing at an error case we're not catching or something?

I190628 15:59:45.676023 3672 sql/distsql_running.go:180 [intExec=adopt-job] error vectorizing remote flow d6d8146f-f896-41d8-8c17-82bae5f1bbd3, restarting with vectorize=off and ID 10d20b4f-490d-48b6-943a-a1bc791f5102: syncFlowConsumer unset, unable to create materializer
I don't think this is an error case we're not catching, it seems like a bad plan output from the physical planner. This needs some more investigation for sure.

Copy link
Contributor Author

@asubiotto asubiotto 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 @jordanlewis)


pkg/sql/distsqlrun/column_exec_setup.go, line 1080 at r1 (raw file):

Previously, asubiotto (Alfonso Subiotto Marqués) wrote…

I190628 15:59:45.676023 3672 sql/distsql_running.go:180 [intExec=adopt-job] error vectorizing remote flow d6d8146f-f896-41d8-8c17-82bae5f1bbd3, restarting with vectorize=off and ID 10d20b4f-490d-48b6-943a-a1bc791f5102: syncFlowConsumer unset, unable to create materializer
I don't think this is an error case we're not catching, it seems like a bad plan output from the physical planner. This needs some more investigation for sure.

The common theme seems to be that these things are run through an internal executor, there might be something funky going on when setting up a receiver in those cases.

@asubiotto
Copy link
Contributor Author

bors r=jordanlewis

@craig
Copy link
Contributor

craig bot commented Jul 8, 2019

Build failed (retrying...)

craig bot pushed a commit that referenced this pull request Jul 8, 2019
38557: exec: protect against unset syncFlowConsumer r=jordanlewis a=asubiotto

This should never happen since it implies that the receiver isn't
connected correctly. These happen when a node sends a SetupFlow request
to a remote node where the spec specifies that the response is on that
remote node. We don't see panics in the row execution engine due to
wrapping the syncFlowConsumer with a copyingRowReceiver, but this state
can cause setupVectorized to panic.

This commit protects against this state pending further investigation.

Release note: None

38613: exec: Add support for projection of the IN operator r=rohany a=rohany

vectorized execution now supports statements of the form

```
select x, x IN (1,2,3) from t;
```

Co-authored-by: Alfonso Subiotto Marqués <alfonso@cockroachlabs.com>
Co-authored-by: Rohan Yadav <rohany@alumni.cmu.edu>
@craig
Copy link
Contributor

craig bot commented Jul 8, 2019

Build succeeded

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.

3 participants