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

Guozhang Wang commented on KAFKA-12169:
---------------------------------------

Inside the AbstractCoordinator:

{code}
    public synchronized boolean 
checkAssignmentMatchedSubscription(Collection<TopicPartition> assignments) {
        for (TopicPartition topicPartition : assignments) {
            if (this.subscribedPattern != null) {
                if 
(!this.subscribedPattern.matcher(topicPartition.topic()).matches()) {
                    log.info("Assigned partition {} for non-subscribed topic 
regex pattern; subscription pattern is {}",
                        topicPartition,
                        this.subscribedPattern);

                    return false;
                }
            } else {
                if (!this.subscription.contains(topicPartition.topic())) {
                    log.info("Assigned partition {} for non-subscribed topic; 
subscription is {}", topicPartition, this.subscription);

                    return false;
                }
            }
        }

        return true;
    }
{code}

We only check that the topic names are included in the subscription, but do not 
check their num.partitions against the metadata.

> Consumer can not know paritions change when client leader restart with static 
> membership protocol
> -------------------------------------------------------------------------------------------------
>
>                 Key: KAFKA-12169
>                 URL: https://issues.apache.org/jira/browse/KAFKA-12169
>             Project: Kafka
>          Issue Type: Bug
>          Components: consumer
>    Affects Versions: 2.5.1, 2.6.1
>            Reporter: zou shengfu
>            Priority: Major
>              Labels: bug
>
> Background: 
>  Kafka consumer services run with static membership and cooperative rebalance 
> protocol on kubernetes, and services often restart because of operation. When 
> we added partitions from 1000 to 2000 for the topic, client leader restart 
> with unknown member id at the same time, we found  the consumers do not 
> tigger rebalance and still consume 1000 paritions
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to