apache/seatunnel · warning

failed to commit transactions out of (keep them to retry…

Error message

failed to commit {} transactions out of {} (keep them to retry later)

What it means

A WARN log in XaGroupOpsImpl.commit(). After committing all prepared XA transactions, if some failed transiently (below max commit attempts), they are kept for later retry and this warning reports how many failed out of the original count, together with the transient failure. The commit phase is not considered failed because those transactions will be retried (commit retry on recovery).

Solutions

  1. Nothing to fix if retries succeed — recovery will re-commit retained transactions; monitor for repeated occurrences
  2. Increase commit retry attempts/maxCommitAttempts for flaky networks
  3. Check DB availability and lock contention at commit time
  4. Ensure checkpoint recovery (XA recover) is functioning so retained xids are committed on restart
Defensive patterns

Strategy: retry

Validate before calling

// Confirm DB reachable before checkpoint-complete commit phase
try (Connection c = dataSource.getConnection()) {
    if (!c.isValid(3)) throw new IllegalStateException("DB unhealthy before commit phase");
}

Try / catch

// Transient commit failures are retried by the framework; in user code:
try {
    commitAll(prepared);
} catch (TransientXaException e) {
    LOG.warn("commit failed transiently, will retry on recovery", e);
}

Prevention

When it happens

Trigger: commit() runs XaGroupOps over prepared transactions; one or more commits throw TransientXaException (network blip, lock timeout, temporary DB unavailability); result.getForRetry() is non-empty and a transient failure exists while under maxCommitAttempts.

Common situations: Short network interruptions or DB failover exactly at checkpoint complete; lock contention at commit time; DB connection pool exhaustion during notifyCheckpointComplete.

Understand the failure class

Background: Request timed out: what client-side request timeouts mean across libraries (Request timed out, TIMED_OUT, APITimeoutError) — this error's family across 39 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/cb64887e220301ec. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/xa/XaGroupOpsImpl.java:77

            try {
                LOG.info("committing {} transaction", x.getXid());
                xaFacade.commit(x.getXid(), false);
                result.succeeded(x);
            } catch (XaFacade.TransientXaException e) {
                result.failedTransiently(x.withAttemptsIncremented(), e);
            } catch (Exception e) {
                result.failed(x, e);
            }
        }
        result.getForRetry().addAll(xids);
        // A permanent or unknown commit failure must fail the checkpoint instead of being reported
        // as a successful commit.
        result.throwIfAnyFailed("commit");
        throwIfAnyReachedMaxAttempts(result, maxCommitAttempts);
        result.getTransientFailure()
                .ifPresent(
                        f ->
                                LOG.warn(
                                        "failed to commit {} transactions out of {} (keep them to retry later)",
                                        result.getForRetry().size(),
                                        origSize,
                                        f));
        return result;
    }

    @Override
    public void rollback(List<XidInfo> xids) {
        for (XidInfo x : xids) {
            xaFacade.rollback(x.getXid());
        }
    }

    @Override
    public GroupXaOperationResult<XidInfo> failAndRollback(Collection<XidInfo> xids) {
        GroupXaOperationResult<XidInfo> result = new GroupXaOperationResult<>();
        if (xids.isEmpty()) {

View on GitHub (pinned to cf67b549a7)