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

   ### Purpose of this pull request
   
   A terminal JDBC sink flush failure could leave buffered records pending. A 
later `flush()` or `close()` could execute the same batch again, risking 
duplicate writes.
   
   This patch latches terminal flush and batch-clear failures, prevents 
subsequent flush attempts after that terminal state, and makes buffered 
executors retain their buffers until a successful delegate execution.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, as a bug fix.
   
   Previously, a failed sink flush could be followed by another execution of 
the same batch during a later flush or writer close. Now the original failure 
is preserved and subsequent flushes fail without replaying the batch.
   
   ### How was this patch tested?
   
   Added regression coverage for retry exhaustion, executor failures, 
`clearBatch()` failure after row-level handling, and repeated `flush()` / 
`close()` calls after terminal failure. The tests assert that the executor is 
invoked only once after such a failure.
   
   Ran focused connector-JDBC unit tests locally with JDK 8:
   
   ```shell
   ./mvnw -pl seatunnel-connectors-v2/connector-jdbc -am \
     -Dtest=JdbcOutputFormatTest,InsertOrUpdateBatchStatementExecutorTest \
     -DfailIfNoTests=false test
   ```
   
   Result: 8 tests run, 0 failures, 0 errors.
   
   ### Check list
   
   * [x] No new Jar binary package is added.
   * [x] Documentation and incompatible-change updates are not required for 
this bug fix.
   * [x] No new connector, plugin mapping, distribution dependency, or 
connector configuration is required.
   


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