Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-4677

Avoid unnecessary task movement across threads during rebalance

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.10.2.0
    • 0.11.0.0
    • streams
    • None

    Description

      StreamPartitionAssigner tries to follow a sticky assignment policy to avoid expensive task migration. Currently, it does this in a best-effort approach.
      We could observe a case, for which tasks did migrate for no good reason, thus we assume that the current implementation could be improved to be more sticky.
      The concrete scenario is as follows:
      assume we have topology with 3 tasks, A, B, C
      assume we have 3 threads, each executing one task: 1-A, 2-B, 3-C
      for some reason, thread 1 goes down and a rebalance gets triggered
      thread 2 and 3 get their partitions revoked
      sometimes (not sure what the exact condition for this is), the new assignment flips the assignment for task B and C (task A is newly assigned to either thread 2 or 3)
      > possible new assignment 2(A,C) and 3-B
      There is no obvious reason (like load-balancing) why the task assignment for B and C does change to the other thread resulting in unnecessary task migration.

      Attachments

        Activity

          People

            damianguy Damian Guy
            damianguy Damian Guy
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: