Guozhang Wang created KAFKA-8420:
------------------------------------

             Summary: Graceful handling when consumer switches from subscribe 
to manual assign
                 Key: KAFKA-8420
                 URL: https://issues.apache.org/jira/browse/KAFKA-8420
             Project: Kafka
          Issue Type: Improvement
          Components: consumer
            Reporter: Guozhang Wang


Today if a consumer switches between subscribe (and hence relies on group 
rebalance to get assignment) and manual assign, it may cause unnecessary 
rebalances. For example:

1. consumer.subscribe();
2. consumer.poll();     // join-group request sent, returns empty because poll 
timeout
3. consumer.unsubscribe();
4. consumer.assign(..);
5. consumer.poll();     // sync-group request received, and the assigned 
partitions does not match the current subscription-state. In this case it will 
tries to re-join which is not necessary.

In the worst case (i.e. leader keep sending incompatible assignment), this 
would case the consumer to fall into endless re-joins.

Although it is not a very common usage scenario, it still worth being better 
handled than the status-quo.



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

Reply via email to