DanielLeens opened a new pull request, #11569:
URL: https://github.com/apache/seatunnel/pull/11569

   ### Purpose of this pull request
   
   The JDBC XA commit path could let a checkpoint appear successful after a 
permanent resource-manager commit failure. `XaGroupOpsImpl` recorded the 
failure but did not throw it, while retryable XA exceptions were wrapped before 
the group retry logic could observe them. In the Zeta aggregated-commit path, 
returned attempt counters were also not persisted across checkpoint restart, so 
`max_commit_attempts` could not reliably bound retries.
   
   This patch:
   
   - propagates permanent XA commit failures to fail the checkpoint;
   - preserves `XA_RETRY` and `XAER_RMFAIL` as retryable failures, while 
treating rollback codes such as `XA_RBTRANSIENT` as permanent commit failures;
   - completes bounded aggregated-commit retries in one invocation so Zeta does 
not lose the incremented attempt state;
   - ignores `XAER_NOTA` only when `restoreCommit` replays checkpoint state, 
keeping normal commits strict;
   - adds focused regression tests for error classification, permanent-failure 
propagation, retry exhaustion, bounded aggregated retries, and 
normal-versus-restore commit behavior.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. Previously, a permanent JDBC XA commit failure could be swallowed and 
the checkpoint could be reported as successful. Retryable failures could also 
bypass the intended retry path. After this change, transient 
no-effect/unknown-outcome failures are retried up to the configured limit, and 
permanent or exhausted failures fail the checkpoint instead of producing a 
false success. Recovery replay retains its existing idempotent handling for an 
already-completed transaction.
   
   This closes the silent-failure gap; it does not make an absolute outcome 
claim for heuristic decisions or a non-compliant resource manager.
   
   ### How was this patch tested?
   
   Added unit tests covering:
   
   - `XA_RETRY` and `XAER_RMFAIL` transient classification;
   - rollback and `XAER_NOTA` negative paths;
   - permanent failure propagation and retry exhaustion;
   - bounded retries within one aggregated-committer invocation;
   - strict normal commit versus idempotent restore commit.
   
   Local static validation passed:
   
   ```bash
   ./mvnw spotless:apply -pl seatunnel-connectors-v2/connector-jdbc -am -nsu 
-Dmaven.gitcommitid.skip=true
   ./mvnw spotless:check -pl seatunnel-connectors-v2/connector-jdbc -am -nsu 
-Dmaven.gitcommitid.skip=true
   git diff --check
   ```
   
   Compile, unit, and E2E tests were not run locally under the project review 
constraint; current-head GitHub CI is the functional validation gate.
   
   ### Check list
   
   * [x] No new Jar binary package is added.
   * [x] Documentation changes are not required because no configuration or 
user workflow changes.
   * [x] No incompatible configuration, public SPI, or serialized-state change 
is introduced.
   * [x] Connector registration, plugin mapping, distribution POM, plugin 
config, and E2E registration changes are not applicable to this existing 
connector bug fix.


-- 
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]

Reply via email to