[ 
https://issues.apache.org/jira/browse/FLINK-22141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17322248#comment-17322248
 ] 

Yuan Mei commented on FLINK-22141:
----------------------------------

Please check PGXAConnection source code here: 

https://github.com/pgjdbc/pgjdbc/blob/master/pgjdbc/src/main/java/org/postgresql/xa/PGXAConnection.java


{code:java}
private void commitPrepared(Xid xid) throws XAException {
    try {
      // Check preconditions. The connection mustn't be used for another
      // other XA or local transaction, or the COMMIT PREPARED command
      // would mess it up.
      if (state != State.IDLE
          || conn.getTransactionState() != TransactionState.IDLE) {
        throw new PGXAException(
            GT.tr("Not implemented: 2nd phase commit must be issued using an 
idle connection. commit xid={0}, currentXid={1}, state={2}, 
transactionState={3}", xid, currentXid, state, conn.getTransactionState()),
            XAException.XAER_RMERR);
      }
{code}


> Manually test exactly-once JDBC sink
> ------------------------------------
>
>                 Key: FLINK-22141
>                 URL: https://issues.apache.org/jira/browse/FLINK-22141
>             Project: Flink
>          Issue Type: Test
>          Components: Connectors / JDBC
>            Reporter: Roman Khachatryan
>            Assignee: Yuan Mei
>            Priority: Blocker
>              Labels: pull-request-available, release-testing
>             Fix For: 1.13.0
>
>
> In FLINK-15578, an API and its implementation were added to JDBC connector to 
> support exactly-once semantics for sinks. The implementation uses JDBC XA 
> transactions.
> The scope of this task is to make sure:
>  # The feature is well-documented
>  # The API is reasonably easy to use
>  # The implementation works as expected
>  ## normal case: database is updated on checkpointing
>  ## failure and recovery case: no duplicates inserted, no records skipped
>  ## several DBs: postgressql, mssql, oracle (mysql has a known issue: 
> FLINK-21743)
>  ## concurrent checkpoints > 1, DoP > 1
>  # Logging is meaningful



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to