You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "Asthenia0412 (via GitHub)" <gi...@apache.org> on 2026/09/27 10:20:51 UTC
[PR] [Fix][Zeta] Reset worker tasks after cluster merge [seatunnel]
Asthenia0412 opened a new pull request, #12494:
URL: https://github.com/apache/seatunnel/pull/12494
Closes #12125.
## Summary
Hazelcast calls managed-service reset during cluster merge, but SeaTunnelServer#reset() was empty. Worker task groups could therefore survive the merge while restored task groups at the same logical location were mistaken for still-running executions.
SeaTunnelServer now delegates reset to TaskExecutionService. Reset is serialized with task deployment, cancels active executions through their normal completion path, and permits a restored execution to deploy once the prior generation has been cancelled.
The regression tests cover same-location redeployment and a split-cluster recovery flow that verifies pipeline restoration, running vertices, master failover, and output consistency.
## Validation
- TaskExecutionServiceTest: 19 tests passed on Corretto 8.
- SplitClusterFaultToleranceIT#testStreamJobRestoreInMasterDown: passed.
- Spotless check for both touched modules: passed.
- git diff --check: passed.
- Full reactor ./mvnw -q -DskipTests verify was attempted, but Maven remained waiting for a remote TLS artifact response for 28 minutes and had to be stopped.
--
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] [Fix][Zeta] Reset worker tasks after cluster merge [seatunnel]
Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on PR #12494:
URL: https://github.com/apache/seatunnel/pull/12494#issuecomment-5923907202
Thanks for offering to take the reproduction/evidence side, @yigitcan-ozturk — that lines up well with what is still open on this PR, and using this thread as the coordination point works for me.
The sequence you listed is exactly the one behind the two HIGH findings here: a reset-triggered (or delayed, old-generation) `CANCELED` notification carries only the `TaskGroupLocation`, so the master attributes it to whatever execution is currently at that location. The expected failure signature is the freshly deployed vertex going `RUNNING→CANCELED` and its slot being released while the new task group keeps running on the worker, possibly followed by a spurious pipeline restore. A few concrete asks so the evidence maps cleanly onto those findings:
1. For each `CANCELED` notification observed by the master, please record which execution context (old vs. new generation) actually emitted it, and which execution the master applied it to. That is the core of F1/F2 and the one thing the current logs cannot distinguish.
2. Please include the case where the old generation is still active on the worker when the replacement is deployed at the same `TaskGroupLocation` (not only the case where it has already exited). The existing unit test does not deterministically hit the "is being reset" deploy branch because `BlockTask` exits on interrupt before the redeploy, so a scenario that holds the old context alive across the redeploy would be very useful.
3. For the IT side: the current `SplitClusterFaultToleranceIT` resets workers that never actually left the cluster while the master still tracks them as `RUNNING`, so it behaves more like a failover test than a merge. If you can drive a real eviction-after-heartbeat-timeout followed by rejoin/merge, that would give us the topology this PR targets.
4. If you have the chance, note where `reset()` runs (merge thread) and whether it blocks behind an in-flight `deployTask` (`taskGroup.init()` / `task.init()` / `startedLatch.await()`), since that stall is the MEDIUM robustness finding.
5. If any of your nodes run as `MASTER_AND_WORKER`, please also capture whether the losing side's coordinator/slot state survives the merge — `SeaTunnelServer.reset()` currently only resets the worker side.
Member identities, task-group locations, slot ownership and checkpoint progression, as you proposed, are all welcome. Please post the raw sequence here when you have it; once we can see the attribution path concretely, we can settle on how the notification should carry execution identity.
<!-- streview-comment:1445 -->
--
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] [Fix][Zeta] Reset worker tasks after cluster merge [seatunnel]
Posted by "Asthenia0412 (via GitHub)" <gi...@apache.org>.
Asthenia0412 commented on PR #12494:
URL: https://github.com/apache/seatunnel/pull/12494#issuecomment-6148983131
Hi maintainers! I pushed empty commits to retrigger CI but the fork repo's Build workflow doesn't seem to be triggering on push. Only Notify test workflow and labeler show pending. Could someone help trigger the Build? Thanks!
--
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] [Fix][Zeta] Reset worker tasks after cluster merge [seatunnel]
Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on PR #12494:
URL: https://github.com/apache/seatunnel/pull/12494#issuecomment-6159676970
@Asthenia0412 Yes, please sketch it here first — that's the right call for a change of this size, and I'd rather agree on the shape before you touch more code.
A few things I'd like the sketch to cover so we can evaluate it against the findings:
- **Generation id end-to-end.** Where the generation id is minted (worker side at deploy, or master side and passed down with the deploy request), how it rides along in `TaskExecutionState` / `NotifyTaskStatusOperation`, and what `updateTaskExecutionState` does with a notification whose generation doesn't match the current one for that `TaskGroupLocation` (drop + log, or drop + metric). This is the core of F1/F2.
- **Ordering with `deployTask`.** Even with filtering on the master, I'd like to understand whether the new generation can be deployed at the same location while the old one is still running on the worker, or whether `deployTask` should wait for the old context to actually finish rather than just checking `activeCancellationFuture.isCancelled()`. Filtering alone fixes the master-side attribution; it doesn't by itself prevent two live tasks at one location.
- **Compatibility.** Whether the serialized form of `TaskExecutionState` changes and how a master on the old shape handles a worker on the new shape (or vice versa) during a rolling upgrade.
Separately from the generation-id work, the remaining items from the earlier review still stand and don't depend on this sketch:
- **F3** — `reset()` running the cancellation cascade synchronously under the service monitor, while `deployTask` holds that same monitor across `taskGroup.init()`, `task.init()` and `startedLatch.await()`. Whichever way the generation fix lands, that lock scope should shrink so a merge can't stall behind connector init.
- **F4** — `testResetAllowsRedeployOfTaskGroupAtSameLocation` needs to deterministically hit the "is being reset" deploy branch; with `BlockTask` exiting on interrupt the first context is usually gone before redeploy. Once the generation id exists, this test is also the natural place to assert that a stale CANCELED is ignored.
- **F5** — the IT resets workers that never left the cluster, so it exercises a failover-like path rather than a real split/merge topology.
- **F6** — `SeaTunnelServer.reset()` only resets the worker side on MASTER_AND_WORKER members.
If you'd prefer to split the generation-id change into a follow-up PR and keep this one scoped to the reset wiring plus F3–F6, I'm fine with that too — just say so in the sketch and we can decide what the minimum is for this PR to be safe to merge.
<!-- streview-comment:1737 -->
--
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] [Fix][Zeta] Reset worker tasks after cluster merge [seatunnel]
Posted by "Asthenia0412 (via GitHub)" <gi...@apache.org>.
Asthenia0412 closed pull request #12494: [Fix][Zeta] Reset worker tasks after cluster merge
URL: https://github.com/apache/seatunnel/pull/12494
--
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] [Fix][Zeta] Reset worker tasks after cluster merge [seatunnel]
Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on PR #12494:
URL: https://github.com/apache/seatunnel/pull/12494#issuecomment-5903171247
Thanks for the follow-up at 7edb4031. Going back over the earlier points, I'd like to confirm a few things against the actual changes before signing off:
- **F1 / F2 (location-keyed CANCELED applied to the new generation):** could you point me to where the terminal notification of a reset-flagged context is suppressed, and confirm it covers both orderings — the old generation's callback firing before the redeploy lands, and after the new context has already been registered at the same `TaskGroupLocation`? The second ordering is the one that flipped the fresh vertex to CANCELED and released its slot.
- **F3 (cascade under the service monitor on the merge thread):** does `deployTask` still hold the monitor across `taskGroup.init()`, per-task `task.init()` and `startedLatch.await()` at this head? If so, a merge arriving during connector initialisation can still block on it, even if the `reset()` side no longer runs under the monitor.
- **F4 (non-deterministic unit test):** could you confirm the test now uses a task that ignores interrupts so the "cancelled but still active" deploy branch is actually hit? That was the gap I was after.
- **F5 (IT topology):** I didn't spot a change here. As far as I can tell the IT still resets workers that never left the cluster while the master tracks them as RUNNING, so it exercises a failover-like path rather than a real split-then-merge. If a true split/merge is not feasible in the e2e harness, a short comment in the test stating what it does and does not cover would be fine with me.
- **F6 (`SeaTunnelServer.reset()` worker-only):** if keeping this worker-only is intentional for this PR, that's acceptable to me — please just add a comment in `reset()` noting that on MASTER_AND_WORKER members the coordinator, slot service and finished-context bookkeeping are not reset, so the gap is visible to the next person.
Summary of asks: (1) pointers/confirmation for the two orderings in F1/F2, (2) whether `deployTask` still holds the monitor across init/latch await (F3), (3) confirmation of the interrupt-ignoring task in the unit test (F4), (4) either adjust the IT or document its scope (F5), (5) the `reset()` comment for F6.
<!-- streview-comment:1418 -->
--
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] [Fix][Zeta] Reset worker tasks after cluster merge [seatunnel]
Posted by "Asthenia0412 (via GitHub)" <gi...@apache.org>.
Asthenia0412 commented on PR #12494:
URL: https://github.com/apache/seatunnel/pull/12494#issuecomment-5865113720
Follow-up on the review findings:
The two blocking stale-generation cases and synchronous cancellation under the service monitor are addressed in the current head. Reset now marks generations before cancelling outside the monitor, and terminal notifications from reset generations are suppressed. The redeploy regression test keeps the old task alive through interruption and verifies the replacement generation remains active.
The E2E fixture still does not evict a member from Hazelcast membership; its assertion is scoped to local reset plus master failover, as documented inline in the test. This PR’s `SeaTunnelServer#reset()` handles worker task execution only. Coordinator and slot ownership remain governed by their independent lifecycle paths, and this boundary is now documented at the reset method.
Validation: `TaskExecutionServiceTest` passed with the repository CI’s JDK 8 runtime using `./mvnw -pl seatunnel-engine/seatunnel-engine-server -am -Dtest=TaskExecutionServiceTest -Dsurefire.failIfNoSpecifiedTests=false -DskipITs -Dspotless.check.skip=true package`; `spotless:check` also passed for `seatunnel-engine-server`.
Could you please re-review the current head? The Build check remains ACTION_REQUIRED pending workflow approval, so I have not changed repository Actions settings.
--
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] [Fix][Zeta] Reset worker tasks after cluster merge [seatunnel]
Posted by "Asthenia0412 (via GitHub)" <gi...@apache.org>.
Asthenia0412 commented on PR #12494:
URL: https://github.com/apache/seatunnel/pull/12494#issuecomment-6146830707
@SEZ9 @DanielLeens Pushed 5 commits addressing both sets of feedback — terminal-notification suppression, merge-generation cascade, and worker-task reset logic. All threads resolved. Thanks!
--
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] [Fix][Zeta] Reset worker tasks after cluster merge [seatunnel]
Posted by "Asthenia0412 (via GitHub)" <gi...@apache.org>.
Asthenia0412 commented on PR #12494:
URL: https://github.com/apache/seatunnel/pull/12494#issuecomment-6147079839
@SEZ9 Thanks for the thorough trace. You're right that `deployTask` checking only `activeCancellationFuture.isCancelled()` doesn't guarantee the old task actually finished — the runtime chain you walked (`NotifyTaskStatusOperation` carrying no executionId → vertex matched by location alone → slot released while task still running) is a real race. I read the exact lines you cited and I agree that's where the issue lives.
The fix path I'm thinking about: `TaskExecutionState` should include the generation id, and the coordinator matching in `updateTaskExecutionState` should filter out stale CANCELED notifications from prior generations. That's a larger change than I can safely push blind — want me to sketch it in a draft comment here before I touch more 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] [Fix][Zeta] Reset worker tasks after cluster merge [seatunnel]
Posted by "yigitcan-ozturk (via GitHub)" <gi...@apache.org>.
yigitcan-ozturk commented on PR #12494:
URL: https://github.com/apache/seatunnel/pull/12494#issuecomment-5921695837
Hi @Asthenia0412 — Daniel pointed me here from #12125 to avoid duplicating the implementation.
I’d like to help specifically on the reproduction/evidence side for the remaining merge/reset interleaving.
I’ll keep this separate from your code changes and focus on exercising the sequence:
- worker eviction after heartbeat timeout,
- losing-side rejoin / cluster merge and `reset()`,
- replacement deployment at the same `TaskGroupLocation`,
- delayed terminal completion from the old generation after the replacement is live,
- checkpoint progression and execution identity tracking across the transition.
I’ll capture member identities, task-group locations, old/new execution context identity, slot ownership where visible, and checkpoint progression, then report the result here against the current PR behavior.
I won’t open a parallel implementation unless the evidence shows a gap not covered by this PR.
If that works for you, I’ll use this PR as the coordination point for the reproduction pass.
--
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] [Fix][Zeta] Reset worker tasks after cluster merge [seatunnel]
Posted by "Asthenia0412 (via GitHub)" <gi...@apache.org>.
Asthenia0412 closed pull request #12494: [Fix][Zeta] Reset worker tasks after cluster merge
URL: https://github.com/apache/seatunnel/pull/12494
--
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