frankvicky commented on code in PR #17614: URL: https://github.com/apache/kafka/pull/17614#discussion_r2029835345
########## clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerMembershipManager.java: ########## @@ -469,8 +493,17 @@ public int joinGroupEpoch() { */ @Override public int leaveGroupEpoch() { - return groupInstanceId.isPresent() ? - ConsumerGroupHeartbeatRequest.LEAVE_GROUP_STATIC_MEMBER_EPOCH : - ConsumerGroupHeartbeatRequest.LEAVE_GROUP_MEMBER_EPOCH; + boolean isStaticMember = groupInstanceId.isPresent(); + if (REMAIN_IN_GROUP == leaveGroupOperation && isStaticMember) { + return ConsumerGroupHeartbeatRequest.LEAVE_GROUP_STATIC_MEMBER_EPOCH; + } + + if (LEAVE_GROUP == leaveGroupOperation) { + return ConsumerGroupHeartbeatRequest.LEAVE_GROUP_MEMBER_EPOCH; Review Comment: Your summary is entirely correct. I will add a comment in the next commit. > I know this would require some server-side changes but maybe this can be a followup KIP? Again, no need to block this PR on that, just putting it out there. Feel free to pick that up yourself or file a ticket if that makes sense to you too. I will file a ticket to trace this one and see if we can gather some feedback. -- 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