release-20.2: colbuilder: disable wrapping of changefeed processors #55753
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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;
orSET vectorize=experimental_always;
, we will always use row-by-rowengine). In 20.1 the meaning of
vectorize=on
was different - we neverlooked 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 theuser runs
SET vectorize=on
.