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

Prioritize assigning standby tasks to threads without any active tasks

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.8.0
    • 3.2.0
    • streams
    • None

    Description

      Currently while distributing the standby tasks streams does not check if there are threads without any tasks or with less number of tasks. This can lead to few threads getting assigned both active and standby tasks when are threads within the same instance without any tasks assigned.

      Example:

      App 1:
      [wordcount-lambda-example-client-StreamThread-1] Handle new assignment with:
       New active tasks: [0_1]
       New standby tasks: [1_0]
       Existing active tasks: []
       Existing standby tasks: [1_0]
      [wordcount-lambda-example-client-StreamThread-2] Handle new assignment with:
       New active tasks: [1_1]
       New standby tasks: []
       Existing active tasks: [1_1]
       Existing standby tasks: []
      [wordcount-lambda-example-client-StreamThread-3] Handle new assignment with:
       New active tasks: []
       New standby tasks: []
       Existing active tasks: []
       Existing standby tasks: []
      [wordcount-lambda-example-client-StreamThread-4] Handle new assignment with:
       New active tasks: []
       New standby tasks: []
       Existing active tasks: []
       Existing standby tasks: []
      

       

      App2:
      [wordcount-lambda-example-client-StreamThread-1] Handle new assignment with:
       New active tasks: [1_0]
       New standby tasks: [1_1]
       Existing active tasks: []
       Existing standby tasks: [1_0, 1_1]
      [wordcount-lambda-example-client-StreamThread-2] Handle new assignment with:
       New active tasks: [0_0]
       New standby tasks: []
       Existing active tasks: []
       Existing standby tasks: []
      [wordcount-lambda-example-client-StreamThread-3] Handle new assignment with:
       New active tasks: []
       New standby tasks: []
       Existing active tasks: []
       Existing standby tasks: []
      [wordcount-lambda-example-client-StreamThread-4] Handle new assignment with:
       New active tasks: []
       New standby tasks: []
       Existing active tasks: []
       Existing standby tasks: []
      

       The standby tasks in both apps is assigned to Thread-1 even though it has an active tasks when Thread-3 and Thread-4 didn't have any tasks assigned.

       

      Attachments

        1. app2.log
          82 kB
          Ravi Bhardwaj
        2. app1.log
          151 kB
          Ravi Bhardwaj

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ravi.bhardwaj Ravi Bhardwaj
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: