Skip to content

Conversation

@BugenZhao
Copy link
Member

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

What's changed and what's your intention?

Previously we have ForceAppendOnly as a SinkType, which allows sinking non-append-only stream to append-only sink by dropping Delete records.

However, whether to drop Delete records can actually be orthogonal to whether the sink is append-only. For example, some users want an upsert sink to process Insert and Update operations as usual while ignoring Delete operations to prevent accidental data deletion in downstream systems.

This PR refactors SinkType::ForceAppendOnly to be SinkType::AppendOnly with a newly introduced ignore_delete field set to true while maintaining backward compatibility, without actual logic changes. In future PRs, we may allow a combination of SinkType::Upsert with ignore_delete to unlock the mentioned use case.

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.
  • I have checked the Release Timeline and Currently Supported Versions to determine which release branches I need to cherry-pick this PR into.

Documentation

  • My PR needs documentation updates.
Release note

@BugenZhao
Copy link
Member Author

BugenZhao commented Dec 31, 2025

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the sink type system by replacing SinkType::ForceAppendOnly with a separate ignore_delete boolean field on SinkType::AppendOnly. This change makes the concept of ignoring delete operations orthogonal to the sink type, enabling future support for combinations like SinkType::Upsert with ignore_delete to allow upsert sinks that ignore delete operations.

  • Introduces a new ignore_delete boolean field in the sink model and protobuf definitions
  • Deprecates SINK_TYPE_FORCE_APPEND_ONLY in proto definitions while maintaining backward compatibility
  • Migrates existing FORCE_APPEND_ONLY sinks to APPEND_ONLY with ignore_delete = true

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
proto/catalog.proto Marks SINK_TYPE_FORCE_APPEND_ONLY as deprecated and adds ignore_delete field to Sink message
proto/stream_plan.proto Adds ignore_delete field to SinkDesc message
proto/connector_service.proto Adds ignore_delete field to SinkParam message
src/prost/src/lib.rs Implements backward compatibility helper methods get_ignore_delete_compat() for multiple types
src/meta/model/src/sink.rs Removes ForceAppendOnly enum variant and adds ignore_delete field, handles conversion with backward compatibility
src/meta/model/migration/src/m20251231_000000_sink_ignore_delete.rs Database migration to add ignore_delete column and normalize deprecated FORCE_APPEND_ONLY rows
src/meta/model/migration/src/lib.rs Registers the new migration
src/meta/src/controller/mod.rs Updates PbSink conversion to include ignore_delete field
src/meta/src/manager/sink_coordination/manager.rs Updates test fixtures with ignore_delete: false
src/frontend/src/optimizer/plan_node/stream_sink.rs Refactors sink type derivation to return tuple of (SinkType, bool) and removes ForceAppendOnly handling
src/connector/src/sink/catalog/mod.rs Removes ForceAppendOnly enum variant, updates conversion logic, adds ignore_delete field to SinkCatalog
src/connector/src/sink/catalog/desc.rs Adds ignore_delete field to SinkDesc
src/connector/src/sink/mod.rs Adds ignore_delete field to SinkParam and uses backward compatibility helper in conversions
src/stream/src/from_proto/sink.rs Retrieves ignore_delete using backward compatibility helper
src/stream/src/executor/sink.rs Refactors to use ignore_delete parameter instead of ForceAppendOnly type, updates compaction and filtering logic
src/bench/sink_bench/main.rs Updates benchmark test fixture with ignore_delete: false

@BugenZhao BugenZhao added this pull request to the merge queue Jan 5, 2026
Merged via the queue into main with commit e99510a Jan 5, 2026
48 checks passed
@BugenZhao BugenZhao deleted the bz/yammering-grasshopper branch January 5, 2026 07:13
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.

3 participants