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

SinkFunction snapshotState don't snapshot all data when trigger a stop-with-drain savepoint

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Not A Problem
    • 1.12.2
    • None
    • None

    Description

      This problem was discovered when I was developing the flink code. In my flink code, my custom sink don't send all data that be produced by event_time window when trigger stop-with-drain savepoint .

      TestSink.java is a example that SinkFunction invoke() continues to run after snapshotState() executed when trigger a stop-with-drain savepoint by rest api.

      //TaskSink.java log
      sink open
      invoke: 0
      invoke: 1
      invoke: 2
      invoke: 3
      invoke: 4
      invoke: 5
      invoke: 6
      invoke: 7
      invoke: 8
      invoke: 9
      ...
      invoke: 425
      invoke: 426
      invoke: 427
      snapshotState
      invoke: 428 // It should be executed before snapshotState.
      sink close

      Attachments

        1. TestSink.java
          2 kB
          Darcy Lin

        Issue Links

          Activity

            People

              ym Yuan Mei
              lintingbin Darcy Lin
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: