showuon commented on code in PR #18165: URL: https://github.com/apache/kafka/pull/18165#discussion_r1939417801
########## clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java: ########## @@ -4081,7 +4084,9 @@ void handleFailure(Throwable throwable) { } private void handleNotControllerError(AbstractResponse response) throws ApiException { - if (response.errorCounts().containsKey(Errors.NOT_CONTROLLER)) { + // When sending requests directly to the follower controller, it might return NOT_LEADER_OR_FOLLOWER error. + if (response.errorCounts().containsKey(Errors.NOT_CONTROLLER) || + metadataManager.usingBootstrapControllers() && response.errorCounts().containsKey(Errors.NOT_LEADER_OR_FOLLOWER)) { handleNotControllerError(Errors.NOT_CONTROLLER); Review Comment: Agree. Updated. -- 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