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

feat(sink): change sink type to append only when plan is append-only #20558

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

st1page
Copy link
Contributor

@st1page st1page commented Feb 21, 2025

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

When user does not specify sink type(append-only, force-append-only or upsert), use plan's append only perporty for sink's type.
The sink's type used in sink executor for some " chunk compact with key" behavior. We have found some unexpected compact in the flamegraph which is unnessary for an append-only sink.

Checklist

  • I have written necessary rustdoc comments.
  • I have added necessary unit tests and integration tests.
  • I have added test labels as necessary.
  • I have added fuzzing tests or opened an issue to track them.
  • My PR contains breaking changes.
  • My PR changes performance-critical code, so I will run (micro) benchmarks and present the results.
  • My PR contains critical fixes that are necessary to be merged into the latest release.

Documentation

  • My PR needs documentation updates.
Release note

Copy link
Collaborator

@hzxa21 hzxa21 left a comment

Choose a reason for hiding this comment

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

Thanks for the quick fix.

if let Some(user_defined_sink_type) = user_defined_sink_type {
if user_defined_sink_type == SinkType::AppendOnly {
if user_force_append_only {
return Ok(SinkType::ForceAppendOnly);
Copy link
Contributor

Choose a reason for hiding this comment

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

When upstream is append-only, and user specifies both append-only and force-append-only, the SinkType changed from AppendOnly to ForceAppendOnly.

}
}

Ok(user_defined_sink_type)
Copy link
Contributor

Choose a reason for hiding this comment

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

Regardless of upstream, when user specifies both upsert and force-append-only, it changed from returning error to Ok(SinkType::Upsert).

This is the CI failure.


Ok(user_defined_sink_type)
} else {
if user_force_append_only {
Copy link
Contributor

Choose a reason for hiding this comment

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

If upstream is append-only, and omitting type = will result in SInkType::AppendOnly (the intended new behavior), isn't it more natural to tolerate an unnecessary force-append-only?

We can move this check after the match below and only reject for Upsert.

@st1page st1page marked this pull request as draft February 21, 2025 08:29
@st1page
Copy link
Contributor Author

st1page commented Feb 21, 2025

Thanks for @xiangjinwu's carefully review and I think it much complex than I think... I convert the PR to draft and will add test to cover the branches all...

@tabVersion
Copy link
Contributor

I thought we had enforced the FORMAT ... ENCODE ... syntax.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants