MartijnVisser opened a new pull request, #262:
URL: https://github.com/apache/flink-connector-jdbc/pull/262

   ## What is the purpose of the change
   
   Since #259 a restarted exactly-once JdbcSink rolls back the prepared 
transactions of its own job. Those of an earlier job, or of the same job at 
another parallelism, keep their locks. A transaction id doesn't name the sink, 
so this adds an optional prefix, like the KafkaSink's, to find them.
   
   ## Brief change log
   
   Builds on #259 (FLINK-41060) and #258 (FLINK-41135); only the last five 
commits belong here.
   
   - `JdbcWriter` restores the states of several writers, so a restore at a 
lower parallelism works
   - `JdbcExactlyOnceOptions` takes an optional transaction id prefix; writer 
state version 3
   - With a prefix, a restarted writer also rolls back what earlier jobs and 
parallelisms left under it; without one it warns
   - `discoverAndRollbackOnRecovery` is deprecated
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   
   - `ExactlyOnceJdbcSinkTest#testRestoreAtLowerParallelism` and 
`ExactlyOnceJdbcWriterTest#testRestoreFromSeveralStates*` fail on #259 with 
"more than one state to recover"
   - 
`ExactlyOnceTransactionIdPrefixJdbcSinkTest#testRestoreIntoNewJobAfterAFailure` 
leaves four prepared transactions behind without the rollback commit
   - `XaTransactionTest` (Derby, PostgreSQL): what a writer rolls back with and 
without a prefix
   - `TransactionIdTest` and `JdbcWriterStateSerializerTest`, which reads a 
4.1.0 state
   
   ## Does this pull request potentially affect one of the following parts:
   
   - Dependencies (does it add or upgrade a dependency): no
   - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: yes
   - The serializers: yes
   - The runtime per-record code paths (performance sensitive): no
   - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Kubernetes/Yarn, ZooKeeper: yes
   - The S3 file system connector: no
   
   ## Documentation
   
   - Does this pull request introduce a new feature? yes
   - If yes, how is the feature documented? docs
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   
   Generated-by: Claude Code (Claude Opus 5.5)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to