vvivekiyer commented on code in PR #13327: URL: https://github.com/apache/pinot/pull/13327#discussion_r1631717268
########## pinot-core/src/main/java/org/apache/pinot/core/transport/AsyncQueryResponse.java: ########## @@ -56,13 +56,17 @@ public AsyncQueryResponse(QueryRouter queryRouter, long requestId, Set<ServerRou _requestId = requestId; int numServersQueried = serversQueried.size(); _responseMap = new ConcurrentHashMap<>(HashUtil.getHashMapCapacity(numServersQueried)); + _serverRoutingStatsManager = serverRoutingStatsManager; for (ServerRoutingInstance serverRoutingInstance : serversQueried) { + // Record stats related to query submission just before sending the request. Otherwise, if the response is + // received immediately, there's a possibility of updating query response stats before updating query + // submission stats. + _serverRoutingStatsManager.recordStatsAfterQuerySubmission(requestId, serverRoutingInstance.getInstanceId()); Review Comment: For low latency usecases at high qps, this can cause the issue mentioned in comments. Hence we update the stats just before submitting. I've updated the method name to better convey this. -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org