aloknnikhil opened a new pull request, #12017:
URL: https://github.com/apache/kafka/pull/12017

   With KAFKA-13527 / KIP-784 we introduced a new top-level error code for
   the DescribeLogDirs API for versions 3 and above. However, the change
   regressed the error handling for versions less than 3 since the response
   converter fails to write the non-zero error code out (rightly) for
   versions lower than 3 and drops the response to the client which
   eventually times out instead of receiving an empty log dirs response and
   processing that as a Cluster Auth failure.
   
   With this change, the API conditionally propagates the error code out to
   the client if the request API version is 3 and above. This keeps the
   semantics of the error handling the same for all versions and restores
   the behavior for older versions.
   
   See current behavior in the broker log:
   ```bash
   ERROR] 2022-04-08 01:22:56,406 [data-plane-kafka-request-handler-10] 
kafka.server.KafkaApis - [KafkaApi-0] Unexpected error handling request 
RequestHeader(apiKey=DESCRIBE_LOG_DIRS, apiVersion=0, clientId=sarama, 
correlationId=1) -- DescribeLogDirsRequestData(topics=null)
   org.apache.kafka.common.errors.UnsupportedVersionException: Attempted to 
write a non-default errorCode at version 0
   [ERROR] 2022-04-08 01:22:56,407 [data-plane-kafka-request-handler-10] 
kafka.server.KafkaRequestHandler - [Kafka Request Handler 10 on Broker 0], 
Exception when handling request
   org.apache.kafka.common.errors.UnsupportedVersionException: Attempted to 
write a non-default errorCode at version 0
   ```
   
   ### Committer Checklist (excluded from commit message)
   - [x] Verify design and implementation 
   - [x] Verify test coverage and CI build status
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to