gortiz commented on code in PR #14806:
URL: https://github.com/apache/pinot/pull/14806#discussion_r1917355976


##########
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java:
##########
@@ -277,8 +286,12 @@ protected BrokerResponse handleRequest(long requestId, 
String query, SqlNodeAndO
       BrokerResponseNativeV2 brokerResponse = new BrokerResponseNativeV2();
       brokerResponse.setResultTable(queryResults.getResultTable());
       brokerResponse.setTablesQueried(tableNames);
-      // TODO: Add servers queried/responded stats
       
brokerResponse.setBrokerReduceTimeMs(queryResults.getBrokerReduceTimeMs());
+      // MSE cannot finish if a single queried server did not respond, so we 
can use the same count for
+      // both the queried and responded stats. Minus one prevents the broker 
to be included in the count
+      // (it will always be included because of the root of the query plan)
+      brokerResponse.setNumServersQueried(servers.size() - 1);
+      brokerResponse.setNumServersResponded(servers.size() - 1);

Review Comment:
   We can't know how many servers respond. This is the best we can do without 
actually changing the protocol.
   
   The reason why is that the broker sends stages to the servers it chooses, 
and then a subset of these servers returns the actual data. Ideally, we could 
include involved servers in the stats, but the stats do not support set or list 
types, so we cannot send the different involved segments.
   
   TL;DR: we cannot know how many servers responded in case of an error.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to