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

distsqlrun: syncFlowConsumer unset when running internal executor queries #38651

Closed
asubiotto opened this issue Jul 3, 2019 · 4 comments
Closed
Assignees
Labels
A-sql-vec SQL vectorized engine C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

Comments

@asubiotto
Copy link
Contributor

A panic was discovered in the vectorized flow setup code where Flow.syncFlowConsumer was nil. #38557 mitigates this by checking if the consumer is nil and returning an error which started producing these errors:

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

These seem like bad plans generated by the distsql physical planner when running internal executor queries (read-setting is another example of when this happens). Essentially the node running the internal query generates a plan that says that the final receiver of data of that query should be on the remote node, which is not a state a query should ever be in (how do you get data back to the gateway if the final receiver is on a remote node?).

@asubiotto asubiotto added the A-sql-vec SQL vectorized engine label Jul 3, 2019
@yuzefovich
Copy link
Member

I'm running into this problem when turning vectorize to "streaming."

This can be somewhat reliably (like with 50% probability) reproduced with setting vectorize to on in exec_util.go on alter_table logic test (for example, I used make testbaselogic TESTCONFIG=fakedist FILES=alter_table TESTFLAGS='-test.v -show-logs -show-sql -vmodule=column_exec_setup=2,server=1').

@yuzefovich
Copy link
Member

An interesting observation is that the more logging I add (by, say, adding distsql_running=1 to vmodule) and the more my laptop is loaded, the less likely this failure reproduces.

@awoods187 awoods187 added the C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. label Jul 23, 2019
@yuzefovich
Copy link
Member

yuzefovich commented Jul 23, 2019

I've just confirmed that this issue appears to be caused by not properly using/releasing TableReaderSpecs, and the fix is in #38952.

@asubiotto
Copy link
Contributor Author

Thanks for confirming!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-vec SQL vectorized engine C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
Projects
None yet
3 participants