8000 fix(connector): rollback transaction before closing connection for jdbc sink by chenzl25 · Pull Request #20597 · risingwavelabs/risingwave · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(connector): rollback transaction before closing connection for jdbc sink #20597

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

Merged

Conversation

chenzl25
Copy link
Contributor
@chenzl25 chenzl25 commented Feb 25, 2025

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

What's changed and what's your intention?

  • RisingWave uses transactions (i.e. autoCommit = false) for jdbc sink, however, we haven't rollbacked the transaction before closing connection.
  • In this PR, we also provide a sink parameter jdbc.auto.commit to allow users to control whether to use transaction for jdbc sink.

Example

CREATE SINK s_pg FROM t WITH (
    connector = 'jdbc', 
    jdbc.url = 'jdbc:postgresql://127.0.0.1:5432/dev?user=xxxx&password=xxxx',
    table.name = 't', 
    type = 'upsert', 
    primary_key = 'id', 
    jdbc.query.timeout = 60, 
    jdbc.auto.commit=true
);

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
  • Support jdbc.auto.commit parameter for jdbc sink. the default value is false.

@chenzl25 chenzl25 added the user-facing-changes Contains changes that are visible to users label Feb 25, 2025
@chenzl25 chenzl25 requested a review from wenym1 February 25, 2025 08:31
Copy link
Contributor

Hi, there.

📝 Telemetry Reminder:
If you're implementing this feature, please consider adding telemetry metrics to track its usage. This helps us understand how the feature is being used and improve it further.
You can find the function report_event of telemetry reporting in the following files. Feel free to ask questions if you need any guidance!

  • src/frontend/src/telemetry.rs
  • src/meta/src/telemetry.rs
  • src/stream/src/telemetry.rs
  • src/storage/compactor/src/telemetry.rs
    Or calling report_event_common (src/common/telemetry_event/src/lib.rs) as if finding it hard to implement.
    ✨ Thank you for your contribution to RisingWave! ✨

This is an automated comment created by the peaceiris/actions-label-commenter. Responding to the bot or mentioning it won't have any effect.

@chenzl25 chenzl25 requested a review from xxhZs February 25, 2025 08:31
@github-actions github-actions bot added the type/fix Type: Bug fix. Only for pull requests. label Feb 25, 2025
@chenzl25 chenzl25 added this pull request to the merge queue Feb 25, 2025
Merged via the queue into main with commit 5c3dedf Feb 25, 2025
43 of 44 checks passed
@chenzl25 chenzl25 deleted the dylan/rollback_transaction_before_close_connection_for_jdbc branch February 25, 2025 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/run-e2e-sink-tests type/fix Type: Bug fix. Only for pull requests. user-facing-changes Contains changes that are visible to users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0