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

changefeedccl: Correctly handle stable CDC query functions #117520

Merged
merged 1 commit into from Jan 9, 2024

Conversation

miretskiy
Copy link
Contributor

Custom CDC query functions rely on having "annotations" configured. Prior to this change, these annotations were configured when the CDC query was being evaluated (for each event). However, CDC query also needs to be evaluated when e.g. the changefeed is being created. In this case, the correct annotations were not configured, resulting in failure to create changefeed that use stable, custom CDC function. At this point, there is only one such function: changefeed_creation_time.

This PR refactors and cleans up how semantic and evalution contexts are configured. This now happens in a single place -- namely the withPlanner helper so that correct information is configured at all times.

Fixes #115245

Release note (enterprise change): Fix CDC query to correctly handle changefeed_creation_time() function.

Custom CDC query functions rely on having "annotations" configured.
Prior to this change, these annotations were configured when the
CDC query was being evaluated (for each event).  However, CDC
query also needs to be evaluated when e.g. the changefeed is
being created.  In this case, the correct annotations were not
configured, resulting in failure to create changefeed
that use stable, custom CDC function.  At this point, there
is only one such function: `changefeed_creation_time`.

This PR refactors and cleans up how semantic and evalution
contexts are configured.  This now happens in a single place --
namely the `withPlanner` helper so that correct information
is configured at all times.

Fixes cockroachdb#115245

Release note (enterprise change): Fix CDC query to correctly
handle `changefeed_creation_time()` function.
@miretskiy miretskiy requested a review from a team as a code owner January 8, 2024 22:00
@miretskiy miretskiy requested review from jayshrivastava and removed request for a team January 8, 2024 22:00
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@miretskiy miretskiy added backport-23.1.x Flags PRs that need to be backported to 23.1 backport-23.2.x Flags PRs that need to be backported to 23.2. labels Jan 8, 2024
@miretskiy
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Jan 9, 2024

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Jan 9, 2024

Build succeeded:

@craig craig bot merged commit e4bd2ec into cockroachdb:master Jan 9, 2024
9 checks passed
Copy link

blathers-crl bot commented Jan 9, 2024

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


error creating merge commit from 3ddb521 to blathers/backport-release-23.1-117520: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 23.1.x failed. See errors above.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-23.1.x Flags PRs that need to be backported to 23.1 backport-23.2.x Flags PRs that need to be backported to 23.2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cdceval: v23.1.12: index out of range when accessing Annotations.Get
3 participants