xinnyuli commented on issue #12624: URL: https://github.com/apache/seatunnel/issues/12624#issuecomment-6058722301
@DanielLeens Thanks, this is now in #12625 (still draft). - Queue-scoped state: `ConnectionPoolManager` keeps one `JdbcTransactionState` per queue index, returned by `SimpleJdbcConnectionPoolProviderProxy.getTransactionState()`, so every writer on that index shares it. It records the connection that owns flushed work and whether the interval has already lost work (poisoned). - A full rollback clears the pending fact, but poisons the interval if it discarded another writer's work or work nobody reports. A savepoint rollback keeps the pending state, and poisons only if another writer flushed after the savepoint. Only a successful commit of the pending connection clears it, for all writers. - While poisoned, `commitIfNeeded()` fails for every writer on that connection, in `prepareCommit`, timer flush and `close`. Deterministic two-table tests on one shared connection, as you listed: 1. `sharedQueueRollbackFailsOtherTablesPrepareCommit` / `sharedQueueRollbackFailsOtherTablesClose` 2. `sharedQueueReplacedConnectionFailsOtherTablesCommit` 3. `sharedQueueSavepointRollbackKeepsEarlierBatchesUntilSharedCommit` (plus `sharedQueueSavepointRollbackOverOtherTablesBatchFailsCommit`) On `close()`: on the PR head both branches already went through `commitIfNeeded()` (no direct `connection.commit()`), so they now hit the shared-state guard; test 1 covers the close path. The gap I found was that in row-error mode a non-row-level commit failure closed the connection without rolling back first, which some drivers (e.g. Oracle) turn into a commit. That now rolls back before close, with a regression test in `JdbcSinkWriterTest`. I updated the known limitations in the PR description now that the shared-queue case is covered. CI note: on my fork everything passes except "Build website", which hits the 1h30m limit while building the zh-CN locale. -- 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]
