[FLINK-36512][runtime] Ignore non-rescale-relevant checkpoint failure reasons in adaptive rescale trigger#28745
Open
prashantbh wants to merge 1 commit into
Open
Conversation
Collaborator
… reasons in adaptive rescale trigger Generated-by: Claude Code (Claude Opus 4.8)
prashantbh
force-pushed
the
prashant.bh/FLINK-36512
branch
from
July 15, 2026 09:57
b08e211 to
6a31226
Compare
prashantbh
marked this pull request as ready for review
July 15, 2026 14:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
The Adaptive Scheduler can trigger a rescale after a configurable number of consecutive failed checkpoints (
jobmanager.adaptive-scheduler.rescale-trigger.max-checkpoint-failures). The countdown was decremented on every failed-checkpoint notification, including failures that do not count against the tolerable checkpoint-failure threshold — e.g. checkpoints triggered before all tasks are running during startup/recovery (NOT_ALL_REQUIRED_TASKS_RUNNING), coordinator shutdown, or checkpoint subsumption.As a result, transient pre-flight failures during startup/recovery could drive the countdown to zero and cause a spurious, premature rescale even though no checkpoint ever actually ran and failed.
This change makes the rescale trigger count only the failure reasons that count against the tolerable checkpoint-failure threshold — the exact same set that
CheckpointFailureManagerenforces at the job level — so the two failure-counting mechanisms stay consistent.Brief change log
CheckpointFailureReason#isCountedAgainstFailureThreshold()as the single source of truth for which reasons count toward a failure threshold;CheckpointFailureManager#checkFailureCounterand the Adaptive Scheduler rescale countdown now both consult it (previously the classification was duplicated).CheckpointFailureReasonthrough the checkpoint-stats failure notification path:CheckpointStatsListener#onFailedCheckpoint,CheckpointStatsTracker#reportFailedCheckpointsWithoutInProgress, andFailedCheckpointStats(extracted from theCheckpointExceptioncause chain).Executing#onFailedCheckpointnow ignores non-counted reasons, so pre-flight failures no longer advance the rescale countdown.SCHEDULER_RESCALE_TRIGGER_MAX_CHECKPOINT_FAILURESto reflect the above.Verifying this change
This change added tests and can be verified as follows:
ExecutingTest: parameterized over allCheckpointFailureReasonvalues, asserting the rescale countdown advances iff the reason is counted; plus null-reason and mixed relevant/irrelevant interleaving cases.CheckpointFailureManagerTest: existing tests confirm the refactor to the shared predicate is behavior-preserving.FailedCheckpointStatsTest: reason extraction from a directCheckpointException, a wrappedCheckpointExceptionin the cause chain, a non-CheckpointExceptioncause, and a null cause.CheckpointCoordinatorTest(integration): new cases drive a realCheckpointCoordinator→CheckpointFailureManager→DefaultCheckpointStatsTracker→CheckpointStatsListenerand assert the exact reason delivered for a pre-flight failure (NOT_ALL_REQUIRED_TASKS_RUNNING), an IO failure, and a declined checkpoint — covering both listener paths (reportFailedCheckpointsWithoutInProgressandreportFailedCheckpoint).Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation
rescale-trigger.max-checkpoint-failuresconfig option was updated to reflect the corrected semantics)Was generative AI tooling used to co-author this PR?