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: ensure that spans planned from cdc queries have end keys #143102

Merged
merged 1 commit into from
Mar 19, 2025

Conversation

asg0451
Copy link
Contributor

@asg0451 asg0451 commented Mar 18, 2025

When a cdc query results in a plan that scans a
single key, the end key of the span is unset. This
causes the feed to fail on startup. We now set
span.EndKey = span.Key.Next().

Fixes: #143101

Release note (bug fix): Fixed a bug that caused feeds to fail on startup when
scanning a single key.

@asg0451 asg0451 requested a review from a team as a code owner March 18, 2025 22:47
@asg0451 asg0451 requested review from rharding6373 and removed request for a team March 18, 2025 22:47
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@asg0451 asg0451 force-pushed the fix-cdcquery-single-key-scan branch from 51a8b45 to 64602ec Compare March 18, 2025 22:48
Copy link
Collaborator

@rharding6373 rharding6373 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find!

@asg0451 asg0451 force-pushed the fix-cdcquery-single-key-scan branch from 64602ec to cab9aa8 Compare March 19, 2025 00:41
@asg0451 asg0451 added the backport-all Flags PRs that need to be backported to all supported release branches label Mar 19, 2025
Copy link
Collaborator

@andyyang890 andyyang890 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice

@asg0451 asg0451 force-pushed the fix-cdcquery-single-key-scan branch 2 times, most recently from 07b04c9 to 7ab5371 Compare March 19, 2025 14:24
@asg0451
Copy link
Contributor Author

asg0451 commented Mar 19, 2025

bors r=rharding6373,andyyang890

craig bot pushed a commit that referenced this pull request Mar 19, 2025
143102: changefeedccl: ensure that spans planned from cdc queries have end keys r=rharding6373,andyyang890 a=asg0451

When a cdc query results in a plan that scans a
single key, the end key of the span is unset. This
causes the feed to fail on startup. We now set
span.EndKey = span.Key.Next().

Fixes: #143101

Release note (bug fix): Fixed a bug that caused feeds to fail on startup when
scanning a single key.


Co-authored-by: Miles Frankel <[email protected]>
@asg0451
Copy link
Contributor Author

asg0451 commented Mar 19, 2025

bors cancel

@craig
Copy link
Contributor

craig bot commented Mar 19, 2025

Canceled.

@asg0451 asg0451 force-pushed the fix-cdcquery-single-key-scan branch from 7ab5371 to 7b0c306 Compare March 19, 2025 15:15
@asg0451
Copy link
Contributor Author

asg0451 commented Mar 19, 2025

bors r=rharding6373,andyyang890

@craig
Copy link
Contributor

craig bot commented Mar 19, 2025

🕐 Waiting for PR status (GitHub check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set.

@asg0451
Copy link
Contributor Author

asg0451 commented Mar 19, 2025

bors r=rharding6373,andyyang890

craig bot pushed a commit that referenced this pull request Mar 19, 2025
143102: changefeedccl: ensure that spans planned from cdc queries have end keys r=rharding6373,andyyang890 a=asg0451

When a cdc query results in a plan that scans a
single key, the end key of the span is unset. This
causes the feed to fail on startup. We now set
span.EndKey = span.Key.Next().

Fixes: #143101

Release note (bug fix): Fixed a bug that caused feeds to fail on startup when
scanning a single key.


Co-authored-by: Miles Frankel <[email protected]>
@asg0451
Copy link
Contributor Author

asg0451 commented Mar 19, 2025

bors cancel

@craig
Copy link
Contributor

craig bot commented Mar 19, 2025

Canceled.

When a cdc query results in a plan that scans a
single key, the end key of the span is unset. This
causes the feed to fail on startup. We now set
span.EndKey = span.Key.Next().

Fixes: cockroachdb#143101

Release note (bug fix): Fixed a bug that caused feeds to fail on startup when
scanning a single key.
@asg0451 asg0451 force-pushed the fix-cdcquery-single-key-scan branch from 7b0c306 to adb564a Compare March 19, 2025 16:43
@asg0451
Copy link
Contributor Author

asg0451 commented Mar 19, 2025

bors r=rharding6373,andyyang890

@craig
Copy link
Contributor

craig bot commented Mar 19, 2025

🕐 Waiting for PR status (GitHub check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set.

@craig
Copy link
Contributor

craig bot commented Mar 19, 2025

@craig craig bot merged commit 6801e64 into cockroachdb:master Mar 19, 2025
23 of 24 checks passed
Copy link

blathers-crl bot commented Mar 19, 2025

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 adb564a to blathers/backport-release-23.2-143102: 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 release-23.2 failed. See errors above.


error creating merge commit from adb564a to blathers/backport-release-24.1-143102: 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 release-24.1 failed. See errors above.


error creating merge commit from adb564a to blathers/backport-release-24.3-143102: 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 release-24.3 failed. See errors above.


error creating merge commit from adb564a to blathers/backport-release-25.1-143102: 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 release-25.1 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-all Flags PRs that need to be backported to all supported release branches backport-failed target-release-25.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

changefeedccl: changefeeds with cdc queries fail when the query results in a single key scan
4 participants