[ 
https://issues.apache.org/jira/browse/KAFKA-7961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16774630#comment-16774630
 ] 

ASF GitHub Bot commented on KAFKA-7961:
---------------------------------------

jsancio commented on pull request #6304: KAFKA-7961: Ignore assignment for 
un-subscribed partitions
URL: https://github.com/apache/kafka/pull/6304
 
 
   Whenever the consumer coordinator sends a response that doesn't match the 
client consumer subscription, ignore the assignment and rejoin the group.
   
   Testing strategy: create a mocked client that first sends an assignment 
response that doesn't match the client subscription followed by an assignment 
response that does match the client subscription.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Handle subscription changes with a rebalance in progress
> --------------------------------------------------------
>
>                 Key: KAFKA-7961
>                 URL: https://issues.apache.org/jira/browse/KAFKA-7961
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Jason Gustafson
>            Assignee: Jose Armando Garcia Sancio
>            Priority: Major
>
> Due to wakeups or poll timeouts, it is possible to have a subscription 
> changed while a rebalance is in progress. This can lead to an illegal state 
> error such as the following if some of the assigned partitions no longer 
> match the subscription:
> {code}
> java.lang.IllegalArgumentException: Assigned partition foo-0 for 
> non-subscribed topic; subscription is [bar]
>       at 
> org.apache.kafka.clients.consumer.internals.SubscriptionState.assignFromSubscribed(SubscriptionState.java:192)
>       at 
> org.apache.kafka.clients.consumer.internals.ConsumerCoordinator.onJoinComplete(ConsumerCoordinator.java:249)
>       at 
> org.apache.kafka.clients.consumer.internals.AbstractCoordinator.joinGroupIfNeeded(AbstractCoordinator.java:410)
>       at 
> org.apache.kafka.clients.consumer.internals.AbstractCoordinator.ensureActiveGroup(AbstractCoordinator.java:344)
>       at 
> org.apache.kafka.clients.consumer.internals.ConsumerCoordinator.poll(ConsumerCoordinator.java:344)
>       at 
> org.apache.kafka.clients.consumer.KafkaConsumer.updateAssignmentMetadataIfNeeded(KafkaConsumer.java:1226)
>       at 
> org.apache.kafka.clients.consumer.KafkaConsumer.poll(KafkaConsumer.java:1191)
>       at 
> org.apache.kafka.clients.consumer.KafkaConsumer.poll(KafkaConsumer.java:1176)
> {code}
> Rather than requiring the assignment received from a rebalance to match the 
> subscription, we should just request a rebalance.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to