Jackie-Jiang commented on code in PR #11592:
URL: https://github.com/apache/pinot/pull/11592#discussion_r1372112261
##########
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/SingleConnectionBrokerRequestHandler.java:
##########
@@ -159,11 +164,14 @@ protected BrokerResponseNative processBrokerRequest(long
requestId, BrokerReques
}
int numServersNotResponded = serversNotResponded.size();
if (numServersNotResponded != 0) {
- brokerResponse.setPartialResult(true);
brokerResponse.addToExceptions(new
QueryProcessingException(QueryException.SERVER_NOT_RESPONDING_ERROR_CODE,
String.format("%d servers %s not responded", numServersNotResponded,
serversNotResponded)));
_brokerMetrics.addMeteredTableValue(rawTableName,
BrokerMeter.BROKER_RESPONSES_WITH_PARTIAL_SERVERS_RESPONDED, 1);
}
+ if (totalServersFailedOrNotResponded > 0) {
Review Comment:
This should not be handled here. We can simply check `if
(brokerResponse.getExceptionsSize() > 0)` in the end in
`BaseBrokerRequestHandler` and set the flag.
##########
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseBrokerRequestHandler.java:
##########
@@ -640,13 +641,16 @@ protected BrokerResponse handleRequest(long requestId,
String query, @Nullable S
}
exceptions.add(QueryException.getException(QueryException.BROKER_SEGMENT_UNAVAILABLE_ERROR,
errorMessage));
_brokerMetrics.addMeteredTableValue(rawTableName,
BrokerMeter.BROKER_RESPONSES_WITH_UNAVAILABLE_SEGMENTS, 1);
+ // If segments are unavailable, the result should be considered partial
+ isPartialResult = true;
Review Comment:
We don't need to update it here. We may set the value in the end by checking
if the response contains exceptions
--
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]