Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-12142

Add beforeSnapshot method to StreamOperator interface

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Not A Problem
    • None
    • None
    • None

    Description

      Right now, when a stream task receives a triggerCheckpoint call, it immediately forwards the checkpoint barrier and performs the checkpoint operation under the checkpoint lock.

      This mechanism doesn't allow the stream operations to implement any logic that should be performed before the snapshot is triggered in order to ensure state consistency.

      Some examples would be:

      • Flushing any state (or other kind of) cache that is implemented in the operator layer
      • Wait for pending operations (maybe with a different async execution model)

      The method could for instance look simply like this in the StreamOperator interface:
      default void beforeSnapshot(long checkpointId, long timestamp) throws Exception {}; 

      This method should then be called before the barrier is sent downstream still outside the checkpoint lock.

      Attachments

        Activity

          People

            Unassigned Unassigned
            gyfora Gyula Fora
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: