dongnuo123 commented on code in PR #15721:
URL: https://github.com/apache/kafka/pull/15721#discussion_r1571469219


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:
##########
@@ -777,11 +778,78 @@ public ClassicGroup classicGroup(
         }
     }
 
+    /**
+     * Validates the online downgrade if a consumer member is fenced from the 
consumer group.
+     *
+     * @param consumerGroup The ConsumerGroup.
+     * @param memberId      The fenced member id.
+     * @return A boolean indicating whether it's valid to online downgrade the 
consumer group.
+     */
+    private boolean validateOnlineDowngrade(ConsumerGroup consumerGroup, 
String memberId) {
+        if (!consumerGroupMigrationPolicy.isDowngradeEnabled()) {
+            log.info("Cannot downgrade consumer group {} to classic group 
because the online downgrade is disabled.",
+                consumerGroup.groupId());
+            return false;
+        } else if 
(!consumerGroup.allMembersUseClassicProtocolExcept(memberId)) {

Review Comment:
   For explicitly leaving group we know the remaining one is using the consumer 
group protocol. I'm not sure about the timeout cases. It could be an expired 
classic protocol member.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to