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

New consumer assign should update assignment in background thread

    XMLWordPrintableJSON

Details

    Description

      With the new async consumer, the subscriptionState object is shared between the app thread and the background thread, but in principle all updates to the assignment should happen in the background thread, to avoid race conditions. Note that it's in the background where most updates to the assignment happen, as result of app event processing like unsubscribe, reconciliations, etc.). 

      We've faced such races in places like unsubscribe and close, fixed by ensuring that all assignment updates happen in the background, and this also needs to be reviewed for the consumer.assign. The current implementation triggers an AssignmentChange event that is processed in the background, but that event is not really changing the assignment. It only commits offsets, and the assignment is updated in the app thread by calling subscriptionState.assignFromUser 

      We should consider moving the assignment update to the background thread, as part of the AssignmentChangeEvent.  

      Attachments

        Issue Links

          Activity

            People

              yangpoan PoAn Yang
              lianetm Lianet Magrans
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: