chia7712 commented on code in PR #18295: URL: https://github.com/apache/kafka/pull/18295#discussion_r1898872993
########## core/src/main/scala/kafka/network/SocketServer.scala: ########## @@ -1107,8 +1107,10 @@ private[kafka] class Processor( val header = RequestHeader.parse(buffer) if (apiVersionManager.isApiEnabled(header.apiKey, header.apiVersion)) { header - } else { + } else if (header.isApiVersionDeprecated()) { throw new InvalidRequestException(s"Received request api key ${header.apiKey} with version ${header.apiVersion} which is not enabled") + } else { + throw new UnsupportedVersionException(s"Received request api key ${header.apiKey} with version ${header.apiVersion} which is not supported") Review Comment: Pardon me, this changes the returned exception from `INVALID_REQUEST` to `UNSUPPORTED_VERSION` as `isApiVersionDeprecated` always returns `false` for now. Is it expected? ########## core/src/main/scala/kafka/network/SocketServer.scala: ########## @@ -1107,8 +1107,10 @@ private[kafka] class Processor( val header = RequestHeader.parse(buffer) if (apiVersionManager.isApiEnabled(header.apiKey, header.apiVersion)) { header - } else { + } else if (header.isApiVersionDeprecated()) { Review Comment: Should we add the deprecated versions back to the JSON files? This would enable us to provide more informative error messages to clients, helping them understand why certain APIs are marked as "unsupported" (deprecated, removed, or disabled). -- 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