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: clean up the materializer #39386

Merged
merged 1 commit into from
Aug 7, 2019

Conversation

yuzefovich
Copy link
Member

This commit fixes a bug of not using the context that was updated
during Flow.startInternal to run the last processor in the flow.
This removes the necessity of having an additional ctxCancel
function in the materializer.

Additionally, outputToInputColIdx has been removed from the
materializer since it's always a mapping such that o[i] = i.
I believe it is a remnant of early days of the vectorized engine,
and since then we've been using projection operators to serve
the purpose that was initially envisioned for this mapping.

Fixes: #39384.

Release note: None

@yuzefovich yuzefovich requested review from jordanlewis, asubiotto and a team August 7, 2019 01:51
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@yuzefovich
Copy link
Member Author

Let's see what the build says, but I have high hopes that now that EXISTS issue is finally properly resolved 🤞

Copy link
Contributor

@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.

Great stuff, this makes sense. Anything run with Flow.Run won't have used this context.

Reviewed 8 of 9 files at r1.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @asubiotto, @jordanlewis, and @yuzefovich)


pkg/sql/distsqlrun/flow.go, line 460 at r1 (raw file):

	f.spec = spec
	if f.isVectorized {
		log.VEventf(ctx, 1, "setting up vectorize flow %s", f.id.String())

I find it's nicer to log f.id.Short()


pkg/sql/distsqlrun/flow.go, line 485 at r1 (raw file):

// goroutine. The caller must forward any returned error to syncFlowConsumer if
// set.
func (f *Flow) startInternal(ctx context.Context, doneFn func()) (context.Context, error) {

Add a comment about the context.


pkg/sql/exec/colrpc/outbox.go, line 258 at r1 (raw file):

		return nil
	}
	log.VEvent(ctx, 2, "Outbox is sending metadata")

I think this message is redundant with respect to what is printed out in movedToDraining. Also, in general we should avoid making unrelated changes in the same commit.

Copy link
Member Author

@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! 0 of 0 LGTMs obtained (waiting on @asubiotto and @jordanlewis)


pkg/sql/distsqlrun/flow.go, line 460 at r1 (raw file):

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

I find it's nicer to log f.id.Short()

I agree, done.


pkg/sql/distsqlrun/flow.go, line 485 at r1 (raw file):

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

Add a comment about the context.

Done.


pkg/sql/exec/colrpc/outbox.go, line 258 at r1 (raw file):

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

I think this message is redundant with respect to what is printed out in movedToDraining. Also, in general we should avoid making unrelated changes in the same commit.

I agree that it's redundant, removed (I forgot to clean this up after debugging).

@yuzefovich yuzefovich force-pushed the materializer-cleanup branch from 5dec9d1 to e37e3d2 Compare August 7, 2019 14:19
@yuzefovich
Copy link
Member Author

TFTR!

bors r+

@craig
Copy link
Contributor

craig bot commented Aug 7, 2019

Merge conflict (retrying...)

@yuzefovich
Copy link
Member Author

bors r-

@craig
Copy link
Contributor

craig bot commented Aug 7, 2019

Canceled

@yuzefovich yuzefovich force-pushed the materializer-cleanup branch from e37e3d2 to 69e73c3 Compare August 7, 2019 16:38
This commit fixes a bug of not using the context that was updated
during `Flow.startInternal` to run the last processor in the flow.
This removes the necessity of having an additional `ctxCancel`
function in the materializer.

Additionally, `outputToInputColIdx` has been removed from the
materializer since it's always a mapping such that o[i] = i.
I believe it is a remnant of early days of the vectorized engine,
and since then we've been using projection operators to serve
the purpose that was initially envisioned for this mapping.

Release note: None
@yuzefovich yuzefovich force-pushed the materializer-cleanup branch from 69e73c3 to a73eb98 Compare August 7, 2019 17:06
@yuzefovich
Copy link
Member Author

bors r+

craig bot pushed a commit that referenced this pull request Aug 7, 2019
39159: testutils/lint: convert some checkers to go/analysis r=mjibson a=mjibson

Convert float, unconvert, and timer to go/analysis
(https://godoc.org/golang.org/x/tools/go/analysis). This is the new,
official static analysis framework for Go. These were previously
disabled. Although now they work again, they are not yet hooked up. It
appears difficult to run these from inside a test. The Go people
apparently are steering us toward using the CLI instead. Hence, roachlint.

Add roachlint, a program to run these checkers. Not yet hooked up to
TestLint.

See #33669. Although that mentions using honnef.co/go/tools, that tool
now uses go/analysis: https://staticcheck.io/changes/2019.2#go-analysis.

Release note: None

39386: distsqlrun: clean up the materializer r=yuzefovich a=yuzefovich

This commit fixes a bug of not using the context that was updated
during `Flow.startInternal` to run the last processor in the flow.
This removes the necessity of having an additional `ctxCancel`
function in the materializer.

Additionally, `outputToInputColIdx` has been removed from the
materializer since it's always a mapping such that o[i] = i.
I believe it is a remnant of early days of the vectorized engine,
and since then we've been using projection operators to serve
the purpose that was initially envisioned for this mapping.

Fixes: #39384.

Release note: None

Co-authored-by: Matt Jibson <[email protected]>
Co-authored-by: Yahor Yuzefovich <[email protected]>
@craig
Copy link
Contributor

craig bot commented Aug 7, 2019

Build succeeded

@craig craig bot merged commit a73eb98 into cockroachdb:master Aug 7, 2019
@yuzefovich yuzefovich deleted the materializer-cleanup branch August 7, 2019 19:26
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.

exec: investigate why subqueries still need a separate cancelation function
3 participants