Skip to content

[FLINK-40209][checkpoint] Introduce Regional Checkpoint core mechanism and notification dispatch - #28963

Open
raoraoxiong wants to merge 5 commits into
apache:masterfrom
raoraoxiong:raorao/FLINK-40209-regional-checkpoint-core
Open

[FLINK-40209][checkpoint] Introduce Regional Checkpoint core mechanism and notification dispatch#28963
raoraoxiong wants to merge 5 commits into
apache:masterfrom
raoraoxiong:raorao/FLINK-40209-regional-checkpoint-core

Conversation

@raoraoxiong

Copy link
Copy Markdown
Contributor

Purpose

Implements the core Regional Checkpoint mechanism (FLIP-600 Phase 1-5): when partial pipeline regions fail during a checkpoint, the framework generates a logically complete Completed Checkpoint by combining historical state of failed regions with current state of healthy regions.

Changes

Commit 1: Define interfaces, configuration and refCheckpointId infrastructure

  • CheckpointListener: add notifyRegionalCheckpointComplete (healthy-region tasks) and notifyRegionalCheckpointFallback (failed-region tasks)
  • OperatorCoordinator: add supportsRegionCheckpoint() and checkpointCoordinatorForRegionFallback()
  • Add RegionalCheckpointInfo class
  • Add 3 config options: region.enabled, region.max-failure-ratio, region.max-consecutive-failures
  • Add refCheckpointId field to OperatorSubtaskState + MetadataV7Serializer (backward-compatible)
  • Add CheckpointSubsumeHelper for reference-aware cleanup

Commit 2: Implement core logic and SourceCoordinator fallback

  • Add RegionalCheckpointHandler: decline buffering, region failure judgment, state recombination, two-tier max-consecutive-failures (Tier 1: force next global; Tier 2: abort + reset)
  • Wire CheckpointCoordinator to delegate to RegionalCheckpointHandler
  • Implement SourceCoordinator.checkpointCoordinatorForRegionFallback (split assignment rollback)
  • Add DefaultCompletedCheckpointStore.computeReferencedCheckpointIds for cleaner reference protection

Commit 3: Implement notification dispatch and local state cleanup

  • Extend confirmCheckpoint RPC with fallbackCheckpointId parameter (reuses task-side checkpoint-complete RPC path so notification survives task restarts)
  • Full notification chain: TaskExecutor → Task → StreamTask → SubtaskCheckpointCoordinator → OperatorChain → AbstractUdfStreamOperator → user function
  • Add TaskStateManager.pruneStateForCheckpoint for local state cleanup (FLIP-600 Section 9)

Testing

  • Unit tests: success path, consecutive limit (two-tier), state assembly, deferred abort, cleaner, config, SourceCoordinator fallback, SplitAssignmentTracker
  • All tests pass

Dependencies

  • None (base PR for FLIP-600 Regional Checkpoint)

Generated-by: CodeBuddy Code (GLM-5.2)

@flinkbot

flinkbot commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

…iguration and refCheckpointId infrastructure

- Add CheckpointListener.notifyRegionalCheckpointComplete(long, RegionalCheckpointInfo) for healthy-region tasks
- Add CheckpointListener.notifyRegionalCheckpointFallback(long, long) for failed-region tasks
- Add RegionalCheckpointInfo class with fallback checkpoint subtask mapping
- Add OperatorCoordinator.supportsRegionCheckpoint() and checkpointCoordinatorForRegionFallback()
- Wire OperatorCoordinatorCheckpointContext and OperatorCoordinatorHolder for forwarding
- Add 3 config options: region.enabled, region.max-failure-ratio, region.max-consecutive-failures
- Add refCheckpointId field to OperatorSubtaskState for tracking historical state references
- Add MetadataV7Serializer for backward-compatible serialization of refCheckpointId
- Add refCheckpointId to SubtaskStateStats/TaskStateStats for REST API aggregation
- Add CheckpointSubsumeHelper for reference-aware checkpoint cleanup
- Add regional config fields to CheckpointCoordinatorConfiguration

Generated-by: CodeBuddy Code (GLM-5.2)
…d SourceCoordinator fallback

- Add RegionalCheckpointHandler: decline buffering, region failure judgment, state recombination,
  two-tier max-consecutive-failures (Tier 1: force next global; Tier 2: abort + reset)
- Wire CheckpointCoordinator to delegate regional checkpoint logic to RegionalCheckpointHandler
- Add PendingCheckpoint methods: recordDecline, areAllTasksResponded, markUnacknowledgedTasksAsDeclined,
  reportFallbackSubtaskStats, finalizeRegionalCheckpoint
- Add DefaultCompletedCheckpointStore.computeReferencedCheckpointIds for cleaner reference protection
- Implement SourceCoordinator.supportsRegionCheckpoint() and checkpointCoordinatorForRegionFallback()
- Implement SplitAssignmentTracker per-checkpoint assignment history with backward-compatible serialization
- Wire Regional Checkpoint config through StreamGraph
- Add unit tests: success path, consecutive limit, state assembly, deferred abort, cleaner, config

Generated-by: CodeBuddy Code (GLM-5.2)
@raoraoxiong
raoraoxiong force-pushed the raorao/FLINK-40209-regional-checkpoint-core branch from d79bacb to d73109a Compare August 17, 2026 09:07
…dispatch and local state cleanup

- Extend confirmCheckpoint RPC with fallbackCheckpointId parameter (reuses task-side
  checkpoint-complete RPC path so notification survives task restarts)
- Add Task.notifyRegionalCheckpointFallback + CheckpointableTask.notifyRegionalCheckpointFallbackAsync
- Implement StreamTask.notifyRegionalCheckpointFallbackAsync with SubtaskCheckpointCoordinator
- Add SubtaskCheckpointCoordinator.notifyRegionalCheckpointFallback + OperatorChain propagation
- Add AbstractUdfStreamOperator forwarding to user functions
- Add TaskStateManager.pruneStateForCheckpoint for local state cleanup (FLIP-600 Section 9)
- TaskExecutor.confirmCheckpoint dispatches to notifyRegionalCheckpointFallback or notifyCheckpointComplete

Generated-by: CodeBuddy Code (GLM-5.2)
@raoraoxiong
raoraoxiong force-pushed the raorao/FLINK-40209-regional-checkpoint-core branch from d73109a to 3bbabd8 Compare August 17, 2026 11:54
…@PublicEvolving

The regional checkpoint notification methods added to the @public
CheckpointListener interface broke two CI checks:

- ArchUnit PUBLIC_API_METHODS_USE_ONLY_PUBLIC_API_TYPES failed because
  notifyRegionalCheckpointComplete takes a @PublicEvolving
  RegionalCheckpointInfo argument, while public methods of a @public type
  may only expose @public leaf types. Annotating the method itself as
  @PublicEvolving moves it under the @PublicEvolving rule, which permits
  @PublicEvolving argument types. notifyRegionalCheckpointFallback gets
  the same annotation for consistency, since both are new FLIP-600 API
  that should not yet carry @public stability guarantees.

- AbstractUdfStreamOperatorLifecycleTest#testAllMethodsRegisteredInTest
  failed because StreamOperator extends CheckpointListener, so both new
  default methods surface in StreamOperator.class.getMethods() and must
  be registered in the expected method list.

Generated-by: CodeBuddy Code
…int options

ConfigOptionsDocsCompletenessITCase failed because the three regional
checkpoint options added to CheckpointingOptions were not present in the
generated documentation:

  execution.checkpointing.region.enabled
  execution.checkpointing.region.max-consecutive-failures
  execution.checkpointing.region.max-failure-ratio

The options already carry @Documentation.Section(EXPERT_CHECKPOINTING),
so only the generated HTML was missing. Regenerated with:

  mvn package -Dgenerate-config-docs -pl flink-docs -am -nsu -DskipTests

Generated-by: CodeBuddy Code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants