This is an automated email from the ASF dual-hosted git repository.
fanjia pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-seatunnel.git
The following commit(s) were added to refs/heads/dev by this push:
new 39dae4cfd [Hotfix][Jdbc Sink] fix xa transaction commit failure on
pipeline restore (#3809)
39dae4cfd is described below
commit 39dae4cfd9d78e713025250fe43654bb60685e71
Author: ic4y <[email protected]>
AuthorDate: Wed Dec 28 11:38:38 2022 +0800
[Hotfix][Jdbc Sink] fix xa transaction commit failure on pipeline restore
(#3809)
---
.../connectors/seatunnel/jdbc/internal/xa/XaGroupOpsImpl.java | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git
a/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/xa/XaGroupOpsImpl.java
b/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/xa/XaGroupOpsImpl.java
index a055b795c..09459d6e2 100644
---
a/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/xa/XaGroupOpsImpl.java
+++
b/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/xa/XaGroupOpsImpl.java
@@ -52,12 +52,13 @@ public class XaGroupOpsImpl
List<XidInfo> xids, boolean allowOutOfOrderCommits, int
maxCommitAttempts) {
GroupXaOperationResult<XidInfo> result = new
GroupXaOperationResult<>();
int origSize = xids.size();
- LOG.debug("commit {} transactions", origSize);
+ LOG.info("commit {} transactions", origSize);
for (Iterator<XidInfo> i = xids.iterator();
i.hasNext() && (result.hasNoFailures() ||
allowOutOfOrderCommits); ) {
XidInfo x = i.next();
i.remove();
try {
+ LOG.info("committing {} transaction", x.getXid());
xaFacade.commit(x.getXid(), false);
result.succeeded(x);
} catch (XaFacade.TransientXaException e) {
@@ -67,7 +68,12 @@ public class XaGroupOpsImpl
}
}
result.getForRetry().addAll(xids);
- result.throwIfAnyFailed("commit");
+ //TODO At present, it is impossible to distinguish whether
+ // the repeated Commit failure caused by restore (exception should not
be thrown) or
+ // the failure of normal process Commit (exception should be thrown).
+ // So currently the exception is not thrown.
+
+ // result.throwIfAnyFailed("commit");
throwIfAnyReachedMaxAttempts(result, maxCommitAttempts);
result.getTransientFailure()
.ifPresent(