You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "DanielLeens (via GitHub)" <gi...@apache.org> on 2026/09/07 18:07:28 UTC

[PR] [Test][Zeta] Add E2E coverage for bounded-source streaming completion after master failover (apache/seatunnel#10834) [seatunnel]

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

   ### Purpose of this pull request
   
   Closes a coverage gap in #10834 ("[Bug][Zeta] Job stuck permanently after master failover... affects BATCH / bounded source / job shutdown phase") left open by the merged fix #10836.
   
   #10836 fixed the root cause (`CheckpointCoordinator#readyToCloseStartingTask` not surviving a master failover) and added `CheckpointCoordinatorFailoverIT` tests for it, but those tests only cover:
   - `testBatchJobCompletesAfterMasterFailover`: a BATCH job, with the master killed while rows are still flowing — well before any source has reported ready-to-close.
   - `testStreamJobContinuesAfterMasterFailover`: an UNBOUNDED streaming source that can never finish and is cancelled by hand at the end, so it only proves checkpoint-id continuity, never actual completion.
   
   Neither test proves the scenario #10834 itself names: a STREAMING job whose source is bounded reaching `FINISHED` after a master failover during its shutdown phase. This PR adds `testBoundedStreamJobCompletesAfterMasterFailover`, which does.
   
   ### How was this patch tested?
   
   **New E2E test** (`CheckpointCoordinatorFailoverIT#testBoundedStreamJobCompletesAfterMasterFailover`):
   - Extends the existing shared `CheckpointableSequenceSource` E2E test source (already used by the savepoint-restore and checkpoint-restore-with-stop suites) with an additive, opt-in `exhausted_snapshot_delay_ms` option (default `0`, a no-op). Once the reader has drained every split it will ever receive, this holds `snapshotState()`'s return back for the configured duration, keeping the final checkpoint's acknowledgement pending so the test can deterministically observe the shutdown-phase window instead of racing it.
   - Runs a `STREAMING` job over a bounded `CheckpointableSequenceSource` (`start_offset`/`end_offset` make it finite). The reader drains its range and signals no-more-element, which drives the engine's real completion path (`SourceNoMoreElementOperation` → `LastCheckpointNotifyOperation` → `readyToClose` → persisted under `checkpoint_state_<jobId>_<pipelineId>_ready_to_close`).
   - The test polls that persisted IMap entry directly (via the coordinator's own `getReadyToCloseImapKey()`) until it is set while the job is still `RUNNING`, then kills the master — mirroring the master-kill technique already used by this file's other tests.
   - The first member runs as a `MASTER`-only node (`EngineConfig.ClusterRole.MASTER`) so every task of the job lives on the surviving member, making the failover a pure master switch (`restoreCoordinator(alreadyStarted=true)`) rather than a pipeline restart. This is asserted directly: `restoredPipeline.getPipelineRestoreNum() == 0` guards against the test passing for the wrong reason (a restarted enumerator re-sending its notification would also reach `FINISHED`, without ever exercising the fix).
   - Asserts the job reaches `JobStatus.FINISHED` within a bounded wait and that the sink holds exactly the expected row count.
   
   **Verification evidence** (JDK 8, `-DskipUT=true -DskipIT=false -Dit.test=CheckpointCoordinatorFailoverIT`, `./mvnw spotless:apply` run on both changed modules before every commit):
   - New test run together with all of this file's other tests (`testBatchJobCompletesAfterMasterFailover`, `testStreamJobContinuesAfterMasterFailover`, `testBatchJobCompletesAfterMasterFailoverDuringCloseHandshake`): passed cleanly across 5 separate full-suite runs on this branch (rebased onto current `dev`), all 4 methods green in the majority of runs.
   - The new `testBoundedStreamJobCompletesAfterMasterFailover` itself passed in every one of those runs, plus additional isolated single-method runs performed while diagnosing an unrelated timing question during development — 10+ consecutive passes total, ~47s each.
   - `testBatchJobCompletesAfterMasterFailoverDuringCloseHandshake` (pre-existing, from #12031, untouched by this PR) hit two different transient failures during verification under heavy local back-to-back-build load (a `NoSuchFileException` from a stale local resource copy on my end, and a `Can not get coordinator service from an active master node` race); both were not reproducible on a subsequent clean run and are unrelated to this PR's diff — flagging for awareness in case they are worth a dedicated look, but out of this PR's scope.
   - Confirmed the `CheckpointableSequenceSource` change is purely additive: the new option defaults to `0` (disabled), the reader's public constructor is only invoked from within its own factory, and no other `.conf` fixture (`savepoint-restore/`, `checkpoint-restore-with-stop/`) sets or is affected by the new option.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. Test-only change; no `src/main` files are touched.
   
   ### Check list
   
   * [ ] If any new Jar binary package adding in your PR, please add License Notice
   * [ ] If necessary, please update the documentation
   * [ ] If necessary, please update `incompatible-changes.md`
   
   🤖 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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Test][Zeta] Add E2E coverage for bounded-source streaming completion after master failover (apache/seatunnel#10834) [seatunnel]

Posted by "DanielLeens (via GitHub) via commits" <co...@seatunnel.apache.org>.
DanielLeens commented on PR #12185:
URL: https://github.com/apache/seatunnel/pull/12185#issuecomment-6851105635

   Thanks for the maintenance result. The current exact-head job set confirms attempt 2 is cancelled, with `all-connectors-it-5` JDK 17 failed in its integration-test step ([job 125709573736](https://github.com/DanielLeens/seatunnel/actions/runs/41165731159/job/125709573736)) and `all-connectors-it-3` JDK 11 cancelled. This supersedes my old attempt-1 cancellation-only guidance. The reported TiDB setup failure is a distinct fixture problem; it is not a successful failover acceptance run.
   
   The proposed TiDB readiness change #13269 is still open, so syncing the current base does not incorporate that fix. With the default retry already consumed, retain the TiDB startup/SQL logs and have the run owner decide on a targeted retry after the fixture cause is resolved. Please keep the bounded-stream master-failover test result separate. My source conclusion remains clear; CI and independent maintainer review remain outstanding.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Test][Zeta] Add E2E coverage for bounded-source streaming completion after master failover (apache/seatunnel#10834) [seatunnel]

Posted by "davidzollo (via GitHub) via commits" <co...@seatunnel.apache.org>.
davidzollo commented on PR #12185:
URL: https://github.com/apache/seatunnel/pull/12185#issuecomment-6703635164

   <!-- daniel-pr-action-20261107 -->
   Maintenance follow-up on unchanged head `9c592adb967b7c46568831ebfb5e8dcd6b9fe847`.
   
   The current CI facts are newer than the earlier attempt 1 cancellation note: run41165731159 is now completed/cancelled at attempt 2. Its current job set contains TiDBCDCIT fixture startup failure (all-connectors 5/JDK17 job 125709573736) plus cancelled all-connectors 3/JDK11 job 125709573783. This is not a successful required-check result. The default rerun budget was already consumed before this handling; no extra blind retry was submitted. The PR-signal workflow was authorized so Apache can display the actual fork result.
   
   This is an action/status update, not a new full source review or a maintainer approval. No local functional validation was run.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Test][Zeta] Add E2E coverage for bounded-source streaming completion after master failover (apache/seatunnel#10834) [seatunnel]

Posted by "DanielLeens (via GitHub) via commits" <co...@seatunnel.apache.org>.
DanielLeens commented on PR #12185:
URL: https://github.com/apache/seatunnel/pull/12185#issuecomment-6557775300

   The CI fact in my [existing full review of this exact head](https://github.com/apache/seatunnel/pull/12185#pullrequestreview-5721288320) has changed. That source review is already published; this is a gate clarification, not another full source review on the same version.
   
   Source status: the existing review found no blocking source issue. Its non-blocking suggestions are unchanged.
   
   The [exact-head fork Build](https://github.com/DanielLeens/seatunnel/actions/runs/41165731159) is now `completed` / `cancelled`, attempt 1. Job conclusions: success=4, cancelled=2, skipped=51. Cancelled targets include [Run / Check Helm Chart](https://github.com/DanielLeens/seatunnel/actions/runs/41165731159/job/124444367418), [Run / Sanity check results](https://github.com/DanielLeens/seatunnel/actions/runs/41165731159/job/124444367436). The cancelled jobs have no assigned runner in the retrieved job metadata, so they supply no executed assertion failure. The evidence does not identify why the workflow was cancelled; cancellation alone does not establish a source fix in dev. The run owner should check for a newer active attempt, then resume only the cancelled required jobs. Do not introduce unrelated source/dependency edits or assume branch synchronization repairs cancellation.
   
   The current base comparison is recorded separately. Missing Apache check adoption is distinct from the fork conclusion, and neither is an effective independent approval. Daniel is the author and has READ repository permission.
   
   Checked 2026-11-01T12:12:54.289586+00:00; unchanged head `9c592adb967b7c46568831ebfb5e8dcd6b9fe847`, base `dev`; compare `diverged`, ahead 7 / behind 9; merge `blocked` / `BLOCKED`; review decision `REVIEW_REQUIRED`. Behind/diverged is recorded independently and does not itself request a sync. Daniel has READ repository permission.
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Test][Zeta] Add E2E coverage for bounded-source streaming completion after master failover (apache/seatunnel#10834) [seatunnel]

Posted by "DanielLeens (via GitHub) via commits" <co...@seatunnel.apache.org>.
DanielLeens commented on PR #12185:
URL: https://github.com/apache/seatunnel/pull/12185#issuecomment-6538591737

   Merged `dev` (`3ac2d1cec6a`) into this branch with a plain merge commit (no rebase, no force push). New head: `9c592adb967` (previous head `6446704692`). Only formatting was run locally (module-scoped `spotless:apply`); `git diff origin/dev --name-status` lists only this PR's own 5 files and no deletions.
   
   Conflicts and resolution:
   - `CheckpointCoordinatorFailoverIT.java`: kept both sides. Imports now carry `SubPlan` (this PR) and `ExecutionState` (`dev`); this PR's `testBoundedStreamJobCompletesAfterMasterFailover` and `dev`'s `latestCompletedCheckpoint` helper both remain, with the shared method closing brace restored between them. No line of `dev` was removed.
   
   Compile and tests are left to the fork CI run per the validation policy (queued at the time of writing, no result claimed): https://github.com/DanielLeens/seatunnel/actions/runs/41165731159
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org