MartijnVisser commented on code in PR #259:
URL:
https://github.com/apache/flink-connector-jdbc/pull/259#discussion_r4543267606
##########
flink-connector-jdbc-core/src/main/java/org/apache/flink/connector/jdbc/datasource/transactions/xa/XaTransaction.java:
##########
@@ -141,6 +151,52 @@ public void checkState() {
"inconsistent internal state");
}
+ /**
+ * Rolls back the prepared transactions of this writer from the given
checkpoint on. A failed
+ * attempt may have left them prepared, the restart replays their records,
and the committer
+ * only commits transactions of earlier checkpoints. It runs whether or
not {@code
+ * discoverAndRollbackOnRecovery} is set.
+ */
+ public void rollbackPreparedTxs(long checkpointId) {
+ Collection<Xid> recovered;
+ try {
+ recovered = xaConnectionProvider.recover();
+ } catch (Exception e) {
+ LOG.warn("unable to recover prepared transactions", e);
Review Comment:
Agreed, it fails the task now. MySQL then needs `XA_RECOVER_ADMIN` and
Oracle `SELECT` on `DBA_PENDING_TRANSACTIONS` and `EXECUTE` on `SYS.DBMS_XA`,
also with `withRecoveredAndRollback(false)`, which goes in the release note. A
writer that fails to start also closes its connection now (89c952fa). b2577311
--
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]