davidzollo commented on code in PR #11569:
URL: https://github.com/apache/seatunnel/pull/11569#discussion_r3886927168
##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/sink/JdbcSinkAggregatedCommitter.java:
##########
@@ -70,22 +80,76 @@ private void tryOpen() throws IOException {
@Override
public List<JdbcAggregatedCommitInfo> commit(
List<JdbcAggregatedCommitInfo> aggregatedCommitInfos) throws
IOException {
+ return commitPreparedTransactions(aggregatedCommitInfos);
+ }
+
+ /**
+ * Reconciles checkpoint XIDs with the resource manager using commit-order
evidence. Checkpoint
+ * XIDs from the first still-prepared transaction onward must all be
present in the recovery
+ * scan and are replayed strictly. An all-absent batch is treated as
already resolved, while an
+ * absent prefix before a still-prepared suffix is treated as already
resolved only after that
+ * suffix commits successfully.
+ */
+ @Override
+ public List<JdbcAggregatedCommitInfo> restoreCommit(
+ List<JdbcAggregatedCommitInfo> aggregatedCommitInfos) throws
IOException {
+ tryOpen();
+ for (JdbcAggregatedCommitInfo aggregatedCommitInfo :
aggregatedCommitInfos) {
+ // Refresh RM evidence for every batch because transactions may be
resolved concurrently
+ // during failover while earlier restored batches are being
replayed.
+ replayRecoveredCheckpoint(
+ aggregatedCommitInfo.getXidInfoList(),
recoverCheckpointTransactions());
+ }
Review Comment:
Addressed in c5f4ec0a0d. The Javadoc now identifies DBA or resource-manager
cleanup as the external actor, explains that no second Zeta committer races the
restore, and states that the per-batch recovery scan narrows rather than
eliminates the gap before XA commit.
--
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]