You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
KAFKA-19546: Rebalance should be triggered by subscription change during group protocol downgrade (apache#20580)
Cherry pick KAFKA-19546 to 4.0.
During online downgrade, when a static member using the consumer
protocol which is also the last member using the consumer protocol is
replaced by another static member using the classic protocol with the
same instance id, the latter will take the assignment of the former and
an online downgrade will be triggered.
In the current implementation, if the replacing static member has a
different subscription, no rebalance will be triggered when the
downgrade happens. The patch checks whether the static member has
changed subscription and triggers a rebalance when it does.
Reviewers: Sean Quah <[email protected]>, David Jacot
<[email protected]>
// If the downgrade is triggered by a member leaving the group, a rebalance should be triggered.
1062
+
// If the downgrade is triggered by a member leaving the group or a static
1063
+
// member replacement with a different subscription, a rebalance should be triggered.
1060
1064
if (joiningMember == null) {
1061
-
prepareRebalance(classicGroup, String.format("Downgrade group %s from consumer to classic.", classicGroup.groupId()));
1065
+
prepareRebalance(classicGroup, String.format("Downgrade group %s from consumer to classic for member leaving.", classicGroup.groupId()));
1066
+
} elseif (hasSubscriptionChanged) {
1067
+
prepareRebalance(classicGroup, String.format("Downgrade group %s from consumer to classic for static member replacement with different subscription.", classicGroup.groupId()));
1062
1068
}
1063
1069
1064
1070
log.info("[GroupId {}] Converted the consumer group to a classic group.", consumerGroup.groupId());
0 commit comments