[ 
https://issues.apache.org/jira/browse/KAFKA-21581?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sean Quah updated KAFKA-21581:
------------------------------
    Description: 
When a classic group that has not yet completed its first rebalance (generation 
0) is upgraded to a consumer group by a static consumer-protocol member that 
replaces a classic static member, the ConsumerGroupHeartbeat response returns 
member epoch 0. Epoch 0 is reserved for members joining a group, so the 
coordinator must never return it.

KAFKA-20209's assignor offload will widen this bug to all upgrades at 
generation 0, not just static member replacement upgrades.

Steps to reproduce:
1. Set group.consumer.migration.policy to upgrade, and set 
group.initial.rebalance.delay.ms high enough that the classic group's initial 
rebalance doesn't complete during the test.
2. A classic static member with group.instance.id X joins a new group G. The 
group goes to PreparingRebalance at generation 0 and the JoinGroup stays 
pending.
3. Before the initial rebalance completes, a consumer-protocol member with a 
new member id sends ConsumerGroupHeartbeat to G with member epoch 0, instanceId 
X, and the same subscription as the classic member.
4. The coordinator upgrades G to a consumer group at group epoch 0 and target 
assignment epoch 0, copied from the classic generation. The consumer member 
replaces the classic static member and is reset to epoch 0.
5. The subscription is unchanged, so the group epoch isn't bumped. The 
coordinator considers the target assignment at epoch 0 up to date, and 
reconciles the new member to epoch 0.
6. The heartbeat response returns member epoch 0.

Expected: the member gets an epoch greater than 0.

—

 

This is a special case of KAFKA-21582.

  was:
Previously in KAFKA-20268, we decided to initialize group epochs at 1. Epoch 1 
contains a placeholder empty target assignment for all members and epoch 2 
contains the first real assignment.

When a classic group that has not yet completed its first rebalance (generation 
0) is upgraded to a consumer group by a static consumer-protocol member that 
replaces a classic static member, the ConsumerGroupHeartbeat response returns 
member epoch 0. Epoch 0 is reserved for members joining a group, so the 
coordinator must never return it.

KAFKA-20209's assignor offload will widen this bug to all upgrades at 
generation 0, not just static member replacement upgrades.

Steps to reproduce:
1. Set group.consumer.migration.policy to upgrade, and set 
group.initial.rebalance.delay.ms high enough that the classic group's initial 
rebalance doesn't complete during the test.
2. A classic static member with group.instance.id X joins a new group G. The 
group goes to PreparingRebalance at generation 0 and the JoinGroup stays 
pending.
3. Before the initial rebalance completes, a consumer-protocol member with a 
new member id sends ConsumerGroupHeartbeat to G with member epoch 0, instanceId 
X, and the same subscription as the classic member.
4. The coordinator upgrades G to a consumer group at group epoch 0 and target 
assignment epoch 0, copied from the classic generation. The consumer member 
replaces the classic static member and is reset to epoch 0.
5. The subscription is unchanged, so the group epoch isn't bumped. The 
coordinator considers the target assignment at epoch 0 up to date, and 
reconciles the new member to epoch 0.
6. The heartbeat response returns member epoch 0.

Expected: the member gets an epoch greater than 0.

---

 

This is a special case of KAFKA-21582.


> ConsumerGroupHeartbeat returns member epoch 0 when a static consumer member 
> replaces a classic member during upgrade of a generation-0 group
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: KAFKA-21581
>                 URL: https://issues.apache.org/jira/browse/KAFKA-21581
>             Project: Kafka
>          Issue Type: Bug
>          Components: group-coordinator
>    Affects Versions: 4.0.0
>            Reporter: Sean Quah
>            Assignee: Sean Quah
>            Priority: Major
>
> When a classic group that has not yet completed its first rebalance 
> (generation 0) is upgraded to a consumer group by a static consumer-protocol 
> member that replaces a classic static member, the ConsumerGroupHeartbeat 
> response returns member epoch 0. Epoch 0 is reserved for members joining a 
> group, so the coordinator must never return it.
> KAFKA-20209's assignor offload will widen this bug to all upgrades at 
> generation 0, not just static member replacement upgrades.
> Steps to reproduce:
> 1. Set group.consumer.migration.policy to upgrade, and set 
> group.initial.rebalance.delay.ms high enough that the classic group's initial 
> rebalance doesn't complete during the test.
> 2. A classic static member with group.instance.id X joins a new group G. The 
> group goes to PreparingRebalance at generation 0 and the JoinGroup stays 
> pending.
> 3. Before the initial rebalance completes, a consumer-protocol member with a 
> new member id sends ConsumerGroupHeartbeat to G with member epoch 0, 
> instanceId X, and the same subscription as the classic member.
> 4. The coordinator upgrades G to a consumer group at group epoch 0 and target 
> assignment epoch 0, copied from the classic generation. The consumer member 
> replaces the classic static member and is reset to epoch 0.
> 5. The subscription is unchanged, so the group epoch isn't bumped. The 
> coordinator considers the target assignment at epoch 0 up to date, and 
> reconciles the new member to epoch 0.
> 6. The heartbeat response returns member epoch 0.
> Expected: the member gets an epoch greater than 0.
> —
>  
> This is a special case of KAFKA-21582.



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

Reply via email to