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

Remove the unregistered task from readersAwaitingSplit

    XMLWordPrintableJSON

Details

    Description

      Recently, we faced a problem caused by the unregistered task when using the hive table as a source to do streaming reading.
      I think the problem is that we do not remove the unregistered task from `readersAwaitingSplit` in `ContinuousHiveSplitEnumerator` and `ContinuousFileSplitEnumerator`.

      Assuming that we have two tasks 0 and 1, they all exist in `readersAwaitingSplit`, if there does not exist any new file in the path for a long time. Then, a new split is generated, and it is assigned to task-1. Unfortunately, task-1 can not consume the split successfully, and the exception will be thrown and cause all tasks to restart. The failover will not affect the `readersAwaitingSplit`, but it will clear the `SourceCoordinatorContext#registeredReaders`.
      After restarting, task-0 exists in `readersAwaitingSplit` but not in `registeredReaders`. if task-1 register first and send the request to get split, the SplitEnumerator will assign splits for both task-1 and task-0, but task-0 has not been registered.

      The stack exists in the attachment.

      Attachments

        1. stack.txt
          5 kB
          zoucao

        Activity

          People

            zoucao zoucao
            zoucao zoucao
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: