adixitconfluent commented on code in PR #18959:
URL: https://github.com/apache/kafka/pull/18959#discussion_r1965590620
##########
core/src/main/java/kafka/server/share/DelayedShareFetch.java:
##########
@@ -62,9 +63,13 @@ public class DelayedShareFetch extends DelayedOperation {
private final ReplicaManager replicaManager;
private final BiConsumer<SharePartitionKey, Throwable> exceptionHandler;
private final PartitionMaxBytesStrategy partitionMaxBytesStrategy;
+ private final ShareGroupMetrics shareGroupMetrics;
+ private final Time time;
// The topic partitions that need to be completed for the share fetch
request are given by sharePartitions.
// sharePartitions is a subset of shareFetchData. The order of
insertion/deletion of entries in sharePartitions is important.
private final LinkedHashMap<TopicIdPartition, SharePartition>
sharePartitions;
+ // Tracks the start time to acquire any share partition for a fetch
request.
+ private long acquireStartTimeMs;
Review Comment:
Hmm, maybe we can do this - Keep a global variable to track the amount of
time wasted when the topic partition was tried to be acquired and we were
unsuccessful in acquiring it. Adding this change along with the above change in
my comment should account for that extra time when acquire was unsuccessful and
we would not be adding the time when the request stays idle. Of course, once we
successfully acquire some topic partitions and record the metric, we set that
global variable back to 0. Wdyt @apoorvmittal10
--
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]