David Jacot created KAFKA-21647:
-----------------------------------

             Summary: Upgrading a Stable classic group by static member 
replacement leaves partitions unassigned
                 Key: KAFKA-21647
                 URL: https://issues.apache.org/jira/browse/KAFKA-21647
             Project: Kafka
          Issue Type: Bug
    Affects Versions: 4.0.0
            Reporter: David Jacot
            Assignee: David Jacot


When a static member of a Stable classic group restarts with the consumer 
protocol, the same group.instance.id and the same subscription, the group is 
upgraded to a consumer group that takes the last classic assignment as its 
target assignment. If a partition of a subscribed topic is in no member's 
assignment at that time, the consumer group leaves it unassigned until an 
unrelated change bumps the group epoch: a member joins, leaves or changes its 
subscription, or a subscribed topic changes again. Nobody consumes the 
partition in the meantime. A rolling upgrade of static members restarts every 
member this way, so the partition can stay unassigned after the upgrade has 
completed.

A Stable classic group has such partitions:
* After its topic gained partitions, until the classic leader sees them and 
rejoins.
* With the cooperative protocol, while a partition moves to another member: it 
is revoked in one generation and only assigned in the next one, after the 
members rejoin.

The classic members that rejoin with the same subscription, including the 
leader that sees the new partitions, do not bump the group epoch of the 
consumer group, and neither does the metadata refresh of the coordinator.

*Steps to reproduce*
# Two classic consumers with group.instance.id B and A and the 
cooperative-sticky assignor join group G in this order, subscribed to topic T 
with 2 partitions. G is Stable and B is the leader.
# Add 2 partitions to T.
# Before B refreshes its metadata (metadata.max.age.ms), restart consumer A 
with group.protocol=consumer, the same group.instance.id and the same 
subscription. The default group.consumer.migration.policy allows the upgrade.
# The coordinator upgrades G to a consumer group. T-2 and T-3 are in no 
member's assignment.
# ConsumerGroupDescribe shows T-2 and T-3 in no member's assignment, and they 
stay unassigned after B refreshes its metadata and rejoins.

*Expected:* the upgraded group assigns every partition of its subscribed topics.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to