apoorvmittal10 commented on code in PR #18444:
URL: https://github.com/apache/kafka/pull/18444#discussion_r1920136605


##########
server/src/main/java/org/apache/kafka/server/share/fetch/ShareFetch.java:
##########
@@ -202,11 +209,18 @@ public synchronized Set<TopicIdPartition> 
filterErroneousTopicPartitions(Set<Top
 
     private synchronized void addErroneousToResponse(Map<TopicIdPartition, 
PartitionData> response) {
         if (erroneous != null) {
+            // Track the failed topics for metrics.
+            Set<String> erroneousTopics = new HashSet<>();
             erroneous.forEach((topicIdPartition, throwable) -> {
+                erroneousTopics.add(topicIdPartition.topic());
                 response.put(topicIdPartition, new PartitionData()
                     .setErrorCode(Errors.forException(throwable).code())

Review Comment:
   Yeah, it's good to add. Though in KafkaApis while forming response the 
PartitionIndex is added as well because the map contains TopicIdPartition as 
the key.



-- 
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

Reply via email to