junrao commented on a change in pull request #9944:
URL: https://github.com/apache/kafka/pull/9944#discussion_r661716207
##########
File path:
clients/src/main/java/org/apache/kafka/common/requests/FetchRequest.java
##########
@@ -296,11 +276,23 @@ public AbstractResponse getErrorResponse(int
throttleTimeMs, Throwable e) {
// may not be any partitions at all in the response. For this reason,
the top-level error code
// is essential for them.
Errors error = Errors.forException(e);
- LinkedHashMap<TopicPartition, FetchResponseData.PartitionData>
responseData = new LinkedHashMap<>();
- for (Map.Entry<TopicPartition, PartitionData> entry :
fetchData.entrySet()) {
- responseData.put(entry.getKey(),
FetchResponse.partitionResponse(entry.getKey().partition(), error));
+ List<FetchResponseData.FetchableTopicResponse> topicResponseList = new
ArrayList<>();
+ // For version 13+, we know the client can handle a top level error
code, so we don't need to send back partitions too.
Review comment:
Could we adjust the above comment on "The error is indicated in two
ways: by setting the same error code in all partitions, and by setting the
top-level error code. The form where we set the same error code in all
partitions is needed in order to maintain backwards compatibility with older
versions of the protocol in which there was no top-level error code." ?
##########
File path: core/src/main/scala/kafka/api/ApiVersion.scala
##########
@@ -467,6 +469,13 @@ case object KAFKA_3_0_IV1 extends DefaultApiVersion {
val id: Int = 34
}
+case object KAFKA_3_0_IV2 extends DefaultApiVersion {
Review comment:
If we can't merge this in 3.0, we will need to change the tag to 3.1.
--
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]