lucliu1108 commented on code in PR #21692:
URL: https://github.com/apache/kafka/pull/21692#discussion_r2941180394


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/modern/consumer/ConsumerGroup.java:
##########
@@ -670,11 +670,29 @@ public CommitPartitionValidator validateOffsetCommit(
         // the member should be using the OffsetCommit API version >= 9.
         if (!isTransactional && !member.useClassicProtocol() && apiVersion < 
9) {
             throw new UnsupportedVersionException("OffsetCommit version 9 or 
above must be used " +
-                "by members using the modern group protocol");
+                "by members using the consumer group protocol");
         }
 
-        validateMemberEpoch(memberEpoch, member.memberEpoch(), 
member.useClassicProtocol());
-        return CommitPartitionValidator.NO_OP;
+        // For members using the classic protocol, the epoch must match the 
last epoch sent
+        // in a heartbeat.
+        if (member.useClassicProtocol()) {
+            validateMemberEpoch(memberEpoch, member.memberEpoch(), true);
+            return CommitPartitionValidator.NO_OP;
+        }

Review Comment:
   If we want to use the same logic for member using classic protocol, do we 
need to throw `IllegalGenerationException` instead of 
`StaleMemberEpochException` for  clientEpoch>brokerEpoch situation? 
   
   In `validateMemberEpoch` it looks like we tend to use 
`IllegalGenerationException` for classic members.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to