Hi Zhiwei,

Thanks - good questions. Short answer first: the shared scheduler is only a
delay primitive. It replaces ScheduledExecutorService.schedule and nothing
else, so every checkpoint policy stays where it is today in
CheckpointCoordinator.

On master switchover: there is nothing to recover. The scheduler lives on
SeaTunnelEngineContext, one per member, and holds no job state; a lease
only holds its own outstanding tasks. The new master builds its
coordinators as it does now and each takes a lease from the new member's
scheduler. For an in-place reset, cleanPendingCheckpoint() calls
cancelAll() on the lease instead of shutting down and rebuilding a
two-thread pool; then, `restoreCoordinator()` re-arms as before. A task
that slips through cancellation is harmless, since both scheduled bodies
re-validate coordinator state under the lock before acting.

On schema evolution: schema-change checkpoints go through the same schedule
call with a zero delay, and the exclusion that makes them correct is the
schemaChanging flag plus the coordinator lock, not pool ordering - the old
per-coordinator pool had two threads, so it gave no ordering guarantee
either. What does change is that a zero-delay trigger now takes one
queueing hop before it runs. That only matters if the dispatch pool is
saturated, and the dispatched body is short because the barrier fan-out
already runs on the coordinator executor. I will run
MysqlCDCWithSchemaChangeIT against the branch and report the result rather
than just asserting this.

On single-pipeline failure: the lease is keyed by (jobId, pipelineId) and
owns its own task set, so cancelling one pipeline never touches another.
Pipeline-level failure handling itself is untouched. The only shared thing
is threads, so the risk is head-of-line blocking, not state - which is why
timing and execution are split across two pools. A timer thread only hands
off, so a pipeline blocked in its checkpoint body cannot delay another
pipeline's timer or its own next tick. Both properties have tests.

On checkpointMinPause and the rest: the scheduler never sees them. The
interval check, min-pause deferral, checkpoint and schema-change timeouts,
and the 500ms retry when a checkpoint is already pending all
stay in the coordinator, unchanged. The one caveat worth stating is that
these delays were always lower bounds, since fire time depends on thread
availability; what changes is that the extra term is now dispatch-queue
wait instead of contention on the coordinator's own pool. I would rather
measure that than argue about it, so I propose a follow-up metric for
scheduling delay - scheduled fire time vs actual, per pipeline. That is
also the measurement that would settle whether the pool sizes should become
configurable Options.


Thanks,
Vivek

On Sun, 20 Sept 2026 at 17:01, zhiwei niu <[email protected]> wrote:

> Hi Vivek,
>
> This is a very valuable direction. During the implementation, I think we
> should carefully consider the following scenarios:
> - How should we start or recover the SharedCheckpointScheduler when the
> master node switches over or fails over.
> - How should schema evolution be handled for CDC jobs.
> - In a job containing multiple pipelines, how should we handle the failure
> of a single pipeline.
> - How should other checkpoint-related configuration options, such as
> checkpointMinPause, be handled by the new SharedCheckpointScheduler.
>
> Best regards,
> Zhiwei Niu
>
>
> Vivek Gangavarapu <[email protected]> 于2026年9月17日周四 11:54写道:
>
> > Hi all,
> >
> > I would like to start a discussion on STIP-40, which proposes replacing
> > Zeta's per-coordinator checkpoint timer pool with a member-wide shared
> > scheduler.
> >
> > STIP-40: https://github.com/apache/seatunnel/issues/12339
> > Issue:   https://github.com/apache/seatunnel/issues/12122
> > PR:      https://github.com/apache/seatunnel/pull/12165
> >
> > Problem: CheckpointCoordinator constructs its own two-thread scheduled
> > pool, and CheckpointManager builds one coordinator per pipeline. Timer
> > threads therefore grow linearly with the number of checkpoint-enabled
> > pipelines on a member. A member running 500 of them holds up to 1000
> > threads that are asleep nearly all of the time. The pool is only ever
> used
> > as a timer, with two call sites: the periodic trigger re-arm and the
> > checkpoint-timeout watchdog.
> >
> > Proposal: one shared scheduler per member, with each coordinator holding
> a
> > per-pipeline lease keyed by (jobId, pipelineId) so cancellation stays
> > scoped. Timing and execution are split across two pools so a checkpoint
> > blocking on IO or a slow RPC cannot delay any other pipeline's timers, or
> > its own next tick.
> >
> > No new Option, no default change, no checkpoint or savepoint format
> change,
> > and the single-pending-checkpoint invariant is preserved.
> >
> > The main open question I would like input on: issue #12122 asks for a
> > bounded scheduler. The timer pool is bounded, but the dispatch pool is
> not.
> > Bounding it requires choosing a rejection policy, and a rejected task
> here
> > is a dropped checkpoint trigger or a dropped timeout watchdog. The
> > tradeoffs for each candidate policy are written out in the Design section
> > of the STIP.
> >
> > A secondary question: whether the timer pool size should stay a constant
> or
> > become a configurable Option.
> >
> > Feedback welcome, on the issue or here.
> >
> > Thanks,
> > Vivek
> >
>

Reply via email to