zhangshenghang opened a new pull request, #13475:
URL: https://github.com/apache/seatunnel/pull/13475
### Contribution acknowledgement
Yes — I am contributing this change to **Apache SeaTunnel**, and I confirm
it follows the project's contribution conventions (English PR
title/description, one focused change, formatting and E2E validated locally).
### What this PR does
Adds `CheckpointMinPauseIT`, an E2E regression guard for the **periodic
checkpoint min-pause scheduling** contract in the Zeta engine.
`env { min-pause = ... }` is a user-facing scheduling option (documented in
the checkpoint/fault-tolerance guide).
`CheckpointCoordinator#tryTriggerPendingCheckpoint` uses it to delay the next
**regular** checkpoint until `min-pause` milliseconds have passed since the
previous checkpoint *completed*, regardless of how short `checkpoint.interval`
is. Without that delay, a job whose interval is much shorter than its
checkpoint duration triggers barriers, storage writes and sink commits
back-to-back. Every checkpoint still succeeds, so neither the job status nor
the checkpoint count exposes the regression, but master CPU, storage traffic
and backpressure are multiplied — a checkpoint storm.
### Why this is a boundary with real regression risk
- The min-pause branch is the only thing separating "checkpoint every
interval" from "checkpoint no more often than the engine can complete one plus
the configured pause". Dropping it (or reading it from the wrong config source)
leaves all existing tests green.
- `CheckpointEnableIT` only asserts that checkpoints happen at all for a
configured interval.
- `UnifyEnvParameterIT` maps a `min-pause` value from the job `env` block
but never inspects when checkpoints are actually triggered.
- The savepoint/failover suites wait for checkpoint ids to advance and never
measure the spacing between them.
So the job-level override of `min-pause` (the path users configure) had no
E2E that would fail if it stopped being enforced.
### What the test pins
The test runs one streaming job on an in-JVM master + worker cluster with
`checkpoint.interval = 300` and `min-pause = 3000` in the job `env`. Both the
interval and the min-pause are job-level values, so the test exercises
`JobMaster#createJobCheckpointConfig` as users do. It waits until four regular
checkpoints complete, reads their trigger/completion timestamps from the
cluster-wide checkpoint overview, and requires that:
- four regular checkpoints complete, so the assertion is about a real,
continuing schedule;
- every checkpoint's trigger timestamp is at least `min-pause` (minus a
small scheduler jitter tolerance) after the previous checkpoint's
**completion** timestamp;
- trigger timestamps move forward and the job is still `RUNNING` afterwards,
proving the pause delays checkpoints instead of stalling the coordinator.
### Does this PR introduce _any_ user-facing change?
No. Test-only change: one E2E class and one job fixture.
### How was this patch tested?
```
./mvnw spotless:apply -pl
seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base
./mvnw -pl seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base
-DskipTests -DskipIT=true verify
./mvnw -pl seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base \
-DskipUT=true -DskipIT=false -Dit.test=CheckpointMinPauseIT
-DfailIfNoTests=false verify
```
Result: `Tests run: 1, Failures: 0, Errors: 0` (about 17 s on JDK 17).
I verified the guard is not vacuous: with the fixture's `min-pause`
temporarily set to `-1` (the option default, i.e. disabled), the test fails on
the first pair of checkpoints with
```
Checkpoint 2 started 291 ms after checkpoint 1 completed. min-pause is 3000
ms ...
```
and with `min-pause = 3000` restored it passes. No engine code was modified,
and the fixture is a simple FakeSource -> Console job used only as a test
harness; the scenario is checkpoint scheduling, not connector semantics.
--
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]