-
Notifications
You must be signed in to change notification settings - Fork 715
fix(frontend): reject defining watermarks on upsert source #24113
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
Conversation
Signed-off-by: Bugen Zhao <[email protected]>
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| assert!( | ||
| input.append_only(), | ||
| "StreamWatermarkFilter only supports append-only input, got {}", | ||
| input.stream_kind() | ||
| ); |
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.
Handle non-append-only inputs in StreamWatermarkFilter
The new assert!(input.append_only()) in StreamWatermarkFilter::new will panic whenever a source carries watermarks but its stream kind is upsert/retract. Older clusters could already contain such sources (the preceding binder check only blocks new ones), and planning a new MV on top of them or re-planning during recovery would now crash the frontend instead of returning a user-facing error. Consider returning a structured ErrorCode here or rejecting the plan earlier so existing non-append-only sources with watermarks don’t bring down the service.
Useful? React with 👍 / 👎.
chenzl25
left a comment
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.
LGTM
Signed-off-by: Bugen Zhao <[email protected]>
|
This change is part of the following stack:
Change managed by git-spice. |
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
There is no clear definition of watermarks for upsert/retract streams, and our current impl doesn't expect this to happen as well.
Previously, a
SOURCEhad to be append-only, allowing us to apply theWatermarkFilterdirectly once a user defined a watermark, without any checks. However, since we introduced support for upsert sources in #22856, this assumption is no longer valid, and we need to implement this check.This PR also add tests for the error handling of defining watermarks on non-append-only tables.
Checklist
Documentation
Release note