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-23.1.14-rc: changefeedccl: fix custom key column when used with CDC queries #117555
release-23.1.14-rc: changefeedccl: fix custom key column when used with CDC queries #117555
Conversation
Previously, CDC custom key column caused incorrect behaviour with CDC queries, leading to a `retryable error: No column with name <name> in this row`. This was because we forgot to add columns to `colsByName` map when generating projection rows for CDC queries. This caused [`DatumNamed`](https://github.com/cockroachdb/cockroach/blob/8d74d10e77f020dd0f5c98003f7976b63531de18/pkg/ccl/changefeedccl/cdcevent/event.go#L116-L122) to return a column not found error, This patch addresses the issue by populating the `colsByName` map during the addition of columns for CDC queries. Note that the issue with supporting `ALTER CHANGEFEED` with CDC queries remains unresolved. Fixes: #114196 Release note (bug fix): CDC custom key column now functions with CDC queries correctly. For example, `CREATE CHANGEFEED WITH key_column=..., unordered AS SELECT * FROM table` now works correctly instead of retrying forever. Note that some functionalities with CDC custom keys are not fully supported, see 115267 for more details.
0e36ae6
to
d3d1130
Compare
Thanks for opening a backport. Please check the backport criteria before merging:
If your backport adds new functionality, please ensure that the following additional criteria are satisfied:
Also, please add a brief release justification to the body of your PR to justify this |
EM LGTM ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have detailed code knowledge here, but the change looks sensible given the commit message description, it includes good test coverage, and the issue seems worth shipping a backport for.
Backport 1/1 commits from #115163 on behalf of @wenyihu6.
/cc @cockroachdb/release
Previously, CDC custom key column caused incorrect behaviour with CDC queries,
leading to a
retryable error: No column with name <name> in this row
. This wasbecause we forgot to add columns to
colsByName
map when generating projectionrows for CDC queries. This caused
DatumNamed
to return a column not found error. This patch addresses the issue by populating
the
colsByName
map during the addition of columns for CDC queries. Note thatthe issue with supporting
ALTER CHANGEFEED
with CDC queries remainsunresolved.
Fixes: #114196
Release note (bug fix): CDC custom key column now functions with CDC queries
correctly. For example,
CREATE CHANGEFEED WITH key_column=..., unordered AS SELECT * FROM table
now works correctly instead of retrying forever. Note thatsome functionalities with CDC custom keys are not fully supported, see 115267
for more details.
Release justification: bug fixes for CDC custom key column when used with CDC queries