From 109b225b05f8085810965228db2c319cd232a9f0 Mon Sep 17 00:00:00 2001 From: Patrick Huang Date: Wed, 28 Aug 2024 18:02:58 +0800 Subject: [PATCH 1/2] fix: disable sink decouple for trivial sink --- src/connector/src/sink/trivial.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/connector/src/sink/trivial.rs b/src/connector/src/sink/trivial.rs index 0cfa82c5c4d1..3a5f8d326c3e 100644 --- a/src/connector/src/sink/trivial.rs +++ b/src/connector/src/sink/trivial.rs @@ -64,6 +64,11 @@ impl Sink for TrivialSink { const SINK_NAME: &'static str = T::SINK_NAME; + // Disable sink decoupling for all trivial sinks because it introduces overhead without any benefit + fn is_sink_decouple(_desc: &SinkDesc, user_specified: &SinkDecouple) -> Result { + Ok(false) + } + async fn new_log_sinker(&self, _writer_env: SinkWriterParam) -> Result { Ok(Self(PhantomData)) } From 414e7c72b9f6b26611f4b79ce8090395d7fdb5cf Mon Sep 17 00:00:00 2001 From: Patrick Huang Date: Wed, 28 Aug 2024 18:33:28 +0800 Subject: [PATCH 2/2] fix complie --- src/connector/src/sink/trivial.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/connector/src/sink/trivial.rs b/src/connector/src/sink/trivial.rs index 3a5f8d326c3e..5c5e093c8e0f 100644 --- a/src/connector/src/sink/trivial.rs +++ b/src/connector/src/sink/trivial.rs @@ -15,7 +15,9 @@ use std::marker::PhantomData; use async_trait::async_trait; +use risingwave_common::session_config::sink_decouple::SinkDecouple; +use super::catalog::desc::SinkDesc; use crate::sink::log_store::{LogStoreReadItem, TruncateOffset}; use crate::sink::{ DummySinkCommitCoordinator, LogSinker, Result, Sink, SinkError, SinkLogReader, SinkParam, @@ -65,7 +67,7 @@ impl Sink for TrivialSink { const SINK_NAME: &'static str = T::SINK_NAME; // Disable sink decoupling for all trivial sinks because it introduces overhead without any benefit - fn is_sink_decouple(_desc: &SinkDesc, user_specified: &SinkDecouple) -> Result { + fn is_sink_decouple(_desc: &SinkDesc, _user_specified: &SinkDecouple) -> Result { Ok(false) }