You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "PoAn Yang (Jira)" <ji...@apache.org> on 2024/08/30 00:58:00 UTC

[jira] [Resolved] (KAFKA-17064) New consumer assign should update assignment in background thread

     [ https://issues.apache.org/jira/browse/KAFKA-17064?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

PoAn Yang resolved KAFKA-17064.
-------------------------------
    Resolution: Fixed

> New consumer assign should update assignment in background thread
> -----------------------------------------------------------------
>
>                 Key: KAFKA-17064
>                 URL: https://issues.apache.org/jira/browse/KAFKA-17064
>             Project: Kafka
>          Issue Type: Bug
>          Components: clients, consumer
>    Affects Versions: 3.8.0
>            Reporter: Lianet Magrans
>            Assignee: PoAn Yang
>            Priority: Blocker
>              Labels: consumer-threading-refactor, kip-848-client-support
>             Fix For: 4.0.0
>
>
> 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.  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)