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.2: colbuilder: disable wrapping of changefeed processors #55753

Merged
merged 1 commit into from
Nov 2, 2020

Conversation

yuzefovich
Copy link
Member

Backport 1/1 commits from #55616.

/cc @cockroachdb/release


The root of the problem is that Columnarizer has buffering behavior -
in 20.1 it will be hanging until coldata.BatchSize() (1024 by default)
rows are emitted by the changefeed. On 20.2 and master due to dynamic
batch size behavior it will still be hanging but in a slightly
different manner.

This is less of a problem on 20.2 and the current master because the
vectorized engine will not be used for the changefeed DistSQL flow since
the vectorized row count threshold is never met for it (the estimated
row count for the plan is 0, so unless a user does
SET vectorize_row_count_threshold=0; or
SET vectorize=experimental_always;, we will always use row-by-row
engine). In 20.1 the meaning of vectorize=on was different - we never
looked at the threshold and used the vectorized engine if it was
supported.

In order to fix this issue we simply refuse to wrap the changefeed
processors, so the row-by-row engine will be always used for changefeed
flows.

Fixes: #55605.

Release note (bug fix): The current implementation of changefeeds is
incompatible with the vectorized engine, so whenever the latter is being
used to run the former, it could hang indefinitely. This is now fixed.
Namely, on 20.2 releases this could happen if the user runs
SET vectorize_row_count_threshold=0;, and on 20.1 releases - if the
user runs SET vectorize=on.

@yuzefovich yuzefovich requested review from asubiotto, a team and adityamaru and removed request for a team October 20, 2020 17:00
@cockroach-teamcity
Copy link
Member

This change is Reviewable

The root of the problem is that Columnarizer has buffering behavior -
in 20.1 it will be hanging until coldata.BatchSize() (1024 by default)
rows are emitted by the changefeed. On 20.2 and master due to dynamic
batch size behavior it will still be hanging but in a slightly
different manner.

This is less of a problem on 20.2 and the current master because the
vectorized engine will not be used for the changefeed DistSQL flow since
the vectorized row count threshold is never met for it (the estimated
row count for the plan is 0, so unless a user does
`SET vectorize_row_count_threshold=0;` or
`SET vectorize=experimental_always;`, we will always use row-by-row
engine). In 20.1 the meaning of `vectorize=on` was different - we never
looked at the threshold and used the vectorized engine if it was
supported.

In order to fix this issue we simply refuse to wrap the changefeed
processors, so the row-by-row engine will be always used for changefeed
flows.

Release note (bug fix): The current implementation of changefeeds is
incompatible with the vectorized engine, so whenever the latter is being
used to run the former, it could hang indefinitely. This is now fixed.
Namely, on 20.2 releases this could happen if the user runs
`SET vectorize_row_count_threshold=0;`, and on 20.1 releases - if the
user runs `SET vectorize=on`.
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.

LGTM for 20.2.1

@yuzefovich yuzefovich added the do-not-merge bors won't merge a PR with this label. label Oct 20, 2020
@yuzefovich yuzefovich removed the do-not-merge bors won't merge a PR with this label. label Nov 2, 2020
@yuzefovich yuzefovich merged commit f492c74 into cockroachdb:release-20.2 Nov 2, 2020
@yuzefovich yuzefovich deleted the backport20.2-55616 branch November 2, 2020 20:17
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.

None yet

3 participants