zhangshenghang opened a new pull request, #13337:
URL: https://github.com/apache/seatunnel/pull/13337
Yes.
## Purpose of the change
Fixes #13323
`SubPlan.pipelineRestoreNum` (and `restoreCauses`) were memory-only. A
master failover rebuilds every SubPlan from scratch, so:
- the `job.retry.times` budget restarted at zero on every master switchover
— a crash-looping pipeline could restart indefinitely;
- the recorded restore causes (#13154) were lost exactly when a pipeline is
crash-looping through failovers, which is when an operator needs them most.
## Brief change log
- New `PipelineRestoreInfo` (`dag/physical`): a small `Serializable` record
of `{restoreCount, restoreCauses}`.
- `SubPlan`: computes a per-pipeline IMap key
(`pipeline_restore_<jobId>_<pipelineId>`), writes the record (best-effort, with
a warning on failure — a broken put must not break the restore itself; the
worst case is the previous behavior) in `prepareRestorePipeline` right after
`retainRestoreCause`, and reads it back in the constructor when the SubPlan is
reconstructed after a failover.
- `JobMaster.createJobCleanupRecord`: the new key joins the existing
job-state cleanup, so it is removed together with the pipeline state and the
coordinator keys.
No configuration or public API changes.
## Verifying this change
Extended `SubPlanTest`:
- `shouldCarryTheRestoreBudgetAcrossReconstruction`: drives a real
`prepareRestorePipeline` on one SubPlan, then constructs a second SubPlan from
the **same IMaps** (as a failover rebuild does) and asserts the restore count
and the recorded cause survived;
- `shouldStartANewPipelineWithoutAnyRestore`: a job without persisted info
still starts at zero restores with no causes.
Verified with:
```
./mvnw -pl seatunnel-engine/seatunnel-engine-server test -Dtest=SubPlanTest
```
I verified the fix locally.
--
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]