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: fix schema change boundary race condition #137554

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andyyang890
Copy link
Collaborator

This patch fixes an issue where a schema change could incorrectly
cause a changefeed to fail with an assertion error like received boundary timestamp ... of type ... before reaching existing boundary of type ... due to a race condition between aggregators sending
resolved spans for multiple schema change descriptor updates to
the change frontier.

This patch also renames schemaChangeFrontier to resolvedSpanFrontier
to reflect that not all resolved span boundaries correspond to schema
changes (e.g. initial-scan-only, end time reached). Its private fields
are also now properly encapsulated and new derived struct types for each
processor type have been created to handle the processor-specific
boundary handling logic. The field and method used for tracking whether
a changefeed is considered idle has been extracted from the frontier
struct because it is not related to span progress or boundaries.

Release note (bug fix): An issue where a schema change could
incorrectly cause a changefeed to fail with an assertion error
like received boundary timestamp ... of type ... before reaching existing boundary of type ... has now been fixed.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@andyyang890 andyyang890 force-pushed the 20241213-refactor-schema-change-frontier branch 2 times, most recently from 006e8fa to 9a3efc3 Compare December 16, 2024 22:25
This patch fixes an issue where a schema change could incorrectly
cause a changefeed to fail with an assertion error like `received
boundary timestamp ... of type ... before reaching existing boundary
of type ...` due to a race condition between aggregators sending
resolved spans for multiple schema change descriptor updates to
the change frontier.

This patch also renames `schemaChangeFrontier` to `resolvedSpanFrontier`
to reflect that not all resolved span boundaries correspond to schema
changes (e.g. initial-scan-only, end time reached). Its private fields
are also now properly encapsulated and new derived struct types for each
processor type have been created to handle the processor-specific
boundary handling logic. The field and method used for tracking whether
a changefeed is considered idle has been extracted from the frontier
struct because it is not related to span progress or boundaries.

Release note (bug fix): An issue where a schema change could
incorrectly cause a changefeed to fail with an assertion error
like `received boundary timestamp ... of type ... before reaching
existing boundary of type ...` has now been fixed.
@andyyang890 andyyang890 force-pushed the 20241213-refactor-schema-change-frontier branch from 9a3efc3 to 85c27fb Compare December 16, 2024 23:07
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.

2 participants