cmccabe commented on code in PR #15986: URL: https://github.com/apache/kafka/pull/15986#discussion_r1624871047
########## raft/src/main/java/org/apache/kafka/raft/internals/VoterSet.java: ########## @@ -55,15 +57,41 @@ final public class VoterSet { } /** - * Returns the socket address for a given voter at a given listener. + * Returns the node information for all the given voter ids and listener. * - * @param voter the id of the voter - * @param listener the name of the listener - * @return the socket address if it exists, otherwise {@code Optional.empty()} + * @param voterIds the ids of the voters + * @param listenerName the name of the listener + * @return the node information for all of the voter ids + * @throws IllegalArgumentException if there are missing endpoints */ - public Optional<InetSocketAddress> voterAddress(int voter, String listener) { - return Optional.ofNullable(voters.get(voter)) - .flatMap(voterNode -> voterNode.address(listener)); + public Set<Node> voterNodes(Stream<Integer> voterIds, ListenerName listenerName) { Review Comment: I guess. We have to be a bit careful though, because the quorum topolgy can change over time. If we encounter an old state (that isn't the latest) and that causes us to kill the kcontroller before we can see the latest state, that could be quite bad. -- 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