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

fix(jdbc-sink): relax the check for UPDATE_DELETE op #17289

Merged
merged 3 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,7 @@ public void prepareUpsert(SinkRow row) {
break;
case UPDATE_INSERT:
if (!updateFlag) {
throw Status.FAILED_PRECONDITION
.withDescription(
"an UPDATE_DELETE should precede an UPDATE_INSERT")
.asRuntimeException();
LOG.warn("Missing an UPDATE_DELETE precede an UPDATE_INSERT");
}
jdbcDialect.bindUpsertStatement(upsertStatement, conn, tableSchema, row);
updateFlag = false;
Expand Down Expand Up @@ -364,10 +361,7 @@ public void beginEpoch(long epoch) {}
@Override
public Optional<ConnectorServiceProto.SinkMetadata> barrier(boolean isCheckpoint) {
if (updateFlag) {
throw Status.FAILED_PRECONDITION
.withDescription(
"expected UPDATE_INSERT to complete an UPDATE operation, got `sync`")
.asRuntimeException();
LOG.warn("expect an UPDATE_INSERT to complete an UPDATE operation, got `sync`");
}
return Optional.empty();
}
Expand Down
3 changes: 3 additions & 0 deletions src/stream/src/executor/sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ impl<F: LogStoreFactory> SinkExecutor<F> {
&& !self.sink_param.downstream_pk.is_empty();
// Don't compact chunk for blackhole sink for better benchmark performance.
let compact_chunk = !self.sink.is_blackhole();
tracing::info!("Sink info: sink_id: {} actor_id: {}, need_advance_delete: {}, re_construct_with_sink_pk: {}",
Copy link
Contributor

Choose a reason for hiding this comment

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

Can be tracing::info!(sink_id, actor_id, need_advanc_delete, re_construct_with_sink_pk, "sink info") to avoid manually generating the format string.

sink_id, actor_id, need_advance_delete, re_construct_with_sink_pk);

let processed_input = Self::process_msg(
input,
self.sink_param.sink_type,
Expand Down
Loading