Details
-
Bug
-
Status: Resolved
-
Blocker
-
Resolution: Fixed
-
3.8.0
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
- fixes
-
KAFKA-16022 AsyncKafkaConsumer sometimes complains “No current assignment for partition {}”
- Closed
- is related to
-
KAFKA-16290 Investigate propagating subscription state updates via queues
- Resolved
- relates to
-
KAFKA-17448 New consumer seek should update positions in background thread
- Resolved
- links to