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

release-20.1: colexec: fix premature calls to IdempotentClose in hash router outputs #49624

Merged
merged 1 commit into from
May 28, 2020

Conversation

yuzefovich
Copy link
Member

Backport 1/1 commits from #49333.

/cc @cockroachdb/release


Previously, we were passing in toClose slice of idempotent closers to
every outbox that is the output of a hash router. However, it is
possible that one stream will be closed before others, and this would
prompt the corresponding outbox to close all of the closers prematurely.
Other streams might still be active and ready to consume more data, but
that single outbox would close everything. This is now fixed by making
hash router responsible for closing the whole toClose slice, and it
will do so right before exiting Run method.

Fixes: #49315.

Release note (bug fix): Previously, CockroachDB could return an internal
error or incorrect results on queries when they were run via the
vectorized execution engine and had a hash router in the DistSQL plan.
This could only occur with vectorize=on.

Previously, we were passing in `toClose` slice of idempotent closers to
every outbox that is the output of a hash router. However, it is
possible that one stream will be closed before others, and this would
prompt the corresponding outbox to close all of the closers prematurely.
Other streams might still be active and ready to consume more data, but
that single outbox would close everything. This is now fixed by making
hash router responsible for closing the whole `toClose` slice, and it
will do so right before exiting `Run` method.

Release note (bug fix): Previously, CockroachDB could return an internal
error or incorrect results on queries when they were run via the
vectorized execution engine and had a hash router in the DistSQL plan.
This could only occur with `vectorize=on`.
@yuzefovich yuzefovich requested a review from asubiotto May 28, 2020 02:49
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@yuzefovich yuzefovich merged commit c3c5087 into cockroachdb:release-20.1 May 28, 2020
@yuzefovich yuzefovich deleted the backport20.1-49333 branch May 28, 2020 14:52
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