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


##########
core/src/main/java/kafka/server/share/SharePartitionManager.java:
##########
@@ -693,6 +717,38 @@ private static void removeSharePartitionFromCache(
         }
     }
 
+    /**
+     * The handler to update the failed share fetch request metrics.
+     *
+     * @return A BiConsumer that updates the failed share fetch request 
metrics.
+     */
+    private BiConsumer<Collection<TopicIdPartition>, Boolean> 
failedShareFetchMetricsHandler() {
+        return (topicIdPartitions, allTopicPartitionsFailed) -> {
+            // Update failed share fetch request metric.
+            topicIdPartitions.forEach(topicIdPartition ->
+                
brokerTopicStats.topicStats(topicIdPartition.topicPartition().topic()).failedShareFetchRequestRate().mark());
+            if (allTopicPartitionsFailed) {

Review Comment:
   Thanks @junrao and @AndrewJSchofield. I have updated the behaviour as 
discussed in the thread.
   
   So now only 1 thing differ in ShareFetch vs existing Fetch as mentioned in 
point 2 above by @junrao that for a share fetch if 1 topic with 2 partitions 
arrive and both partitions fail then only 1 fail and share fetch against topic 
will be registered, unlike in existing fetch metrics where 2 will be recorded 
(per partition). 



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