artemlivshits commented on a change in pull request #11688: URL: https://github.com/apache/kafka/pull/11688#discussion_r803251907
########## File path: core/src/main/scala/kafka/coordinator/group/GroupCoordinator.scala ########## @@ -1306,23 +1326,46 @@ class GroupCoordinator(val brokerId: Int, protocolType = group.protocolType, protocolName = group.protocolName, leaderId = currentLeader, + skipAssignment = false, error = error )) + } else if (supportSkippingAssignment) { + // Starting from version 9 of the JoinGroup API, static members are able to + // skip running the assignor based on the `SkipAssignment` field. We leverage + // this to tell the leader that it is the leader of the group but by skipping + // running the assignor while the group is in stable state. Review comment: Can you mention somewhere in the comments that this approach still doesn't fully handle a condition if metadata has changed while the leader was down? ########## File path: connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/WorkerCoordinator.java ########## @@ -211,7 +211,13 @@ protected void onJoinComplete(int generation, String memberId, String protocol, } @Override - protected Map<String, ByteBuffer> performAssignment(String leaderId, String protocol, List<JoinGroupResponseMember> allMemberMetadata) { + protected Map<String, ByteBuffer> onLeaderElected(String leaderId, + String protocol, + List<JoinGroupResponseMember> allMemberMetadata, + boolean skipAssignment) { + if (skipAssignment) + throw new IllegalStateException("Can't skip assignment because Connect does not support static membership."); Review comment: Would it be safer to just log an error and ignore? That would make a difference if we say have a bug and return skipAssignment=true by mistake. -- 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