[
https://issues.apache.org/jira/browse/FLINK-21488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17292533#comment-17292533
]
Maciej Obuchowski commented on FLINK-21488:
-------------------------------------------
XID global/branch identifiers max sizes are defined as 64 bytes, not bits, so
it would fit. Not sure if there are any performance implications of using
longer or shorter ids.
However, seems to me that swapping those would be a simpler solution.
I'll test it tomorrow and will be able to provide PR after.
> Jdbc XA sink - XID generation conflicts between jobs
> ----------------------------------------------------
>
> Key: FLINK-21488
> URL: https://issues.apache.org/jira/browse/FLINK-21488
> Project: Flink
> Issue Type: Bug
> Components: Connectors / JDBC
> Affects Versions: 1.13.0
> Reporter: Maciej Obuchowski
> Priority: Major
>
> I'm using Flink 1.13's JDBC XA sink to write data to oracle DB using exactly
> once semantics.
> I want to have two jobs doing this. One is working right now. When starting
> second one, I encountered errors:
> org.apache.flink.util.FlinkRuntimeException: unable to start XA transaction,
> xid: 201:0600000000000000:9b1d1b84e8ce79bb, error -3: resource manager error
> has occurred. [XAErr (-3): A resource manager error has occured in the
> transaction branch. ORA-2079 SQLErr (0)]
> Oracle description:
> ORA-02079: cannot join a committing distributed transaction
> Cause: Once a transaction branch is prepared, no more new transaction
> branches are allowed to start, nor is the prepared transaction branch allowed
> to be joined.
> Action: Check the application code as this is an XA protocol violation.
> I've looked at the implementation of XID generation and noticed following
> line:
> private transient byte[] gtridBuffer; // globalTransactionId = checkpoint id
> (long)
> My hypothesis is that second job generated xid that referred to global
> transaction id that the first job created. If I'm right, then I'd suppose fix
> would rely on embedding part of job id inside of gtridBuffer.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)