DanielLeens opened a new pull request, #13104:
URL: https://github.com/apache/seatunnel/pull/13104
Yes, contributing to SeaTunnel.
### Purpose
Add an end-to-end regression guard for #12805, fixed by #12807 ("[Fix][API]
Forward restoreCommit to each table in MultiTableSinkAggregatedCommitter").
On restore, Zeta's `SinkAggregatedCommitterTask#restoreState` calls
`restoreCommit` on the job's aggregated committer. Before #12807,
`MultiTableSinkAggregatedCommitter` did not override `restoreCommit`, so the
inherited default sent restored commit infos to `commit`. A JDBC XA sink then
failed with `XAER_NOTA`.
### Why existing tests miss it
- #12807 added only a mocked unit test
(`MultiTableSinkAggregatedCommitterTest`).
- The e2e test sink (`InMemoryAggregatedCommitter`) and the fault-tolerance
ITs' sinks use the default `restoreCommit -> commit`. Both routes give the same
result, so no end-to-end test could tell them apart.
### What the test does
- `InMemoryAggregatedCommitter` (test code in `seatunnel-e2e-common`) now
records `commit:<n>` and `restoreCommit:<n>` in a new thread-safe static list,
`getCommitEvents()`. `restoreCommit` then delegates to `commit`, the same as
the inherited default, so existing tests behave as before. The new list is
separate from the existing `events` list, whose exact contents the starter
`MultiTableSinkTest`s assert. Zeta also calls `restoreCommit(empty)` on every
fresh start.
- New `ClusterFaultToleranceIT#testStreamJobRestoreCommitIn2NodeWorkerDown`:
- Starts two in-JVM nodes with static slots and `SLOT_RATIO`, so the job
is spread over both nodes.
- Runs a STREAMING FakeSource -> InMemory job
(`stream_fake_to_inmemory_restore_commit.conf`). `InMemorySink` implements
`SupportMultiTableSink`, so
`MultiTableJobConfigParser#tryGenerateMultiTableSink` wraps this single-table
sink in `MultiTableSink`.
- Clears the event list at test start, then waits for at least 2 non-empty
commits, which means completed checkpoints with committer state exist.
- Checks that node2 holds assigned slots, then shuts node2 down to force a
pipeline restore.
- Asserts that a non-empty `restoreCommit:<n>` event appears and that the
job returns to RUNNING. It then cancels the job.
### How it fails on pre-fix code
If #12807 is reverted, `MultiTableSinkAggregatedCommitter.restoreCommit`
falls back to its own `commit`. The restored commit info then shows up only as
`commit:1`, and no non-empty `restoreCommit` event is ever recorded. The
`restoreCommit` await fails after 180s, and its message lists the recorded
events.
### Verification
Spotless only locally; GitHub CI is the verification.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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]