klsince commented on code in PR #11978:
URL: https://github.com/apache/pinot/pull/11978#discussion_r1406600662
##########
pinot-core/src/main/java/org/apache/pinot/core/routing/RoutingTable.java:
##########
@@ -18,27 +18,39 @@
*/
package org.apache.pinot.core.routing;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import org.apache.commons.lang3.tuple.Pair;
import org.apache.pinot.core.transport.ServerInstance;
public class RoutingTable {
- private final Map<ServerInstance, List<String>> _serverInstanceToSegmentsMap;
+ // Optional segments are those not online as in ExternalView but might have
been online on servers already, e.g.
+ // the newly created consuming segments. Such segments were simply skipped
by brokers at query routing time, but that
+ // had caused wrong query results, particularly for upsert tables. Instead,
we should pass such segments to servers
+ // and let them decide how to handle them, e.g. skip them upon issues or
include them for better query results.
+ private final Map<ServerInstance, Pair<List<String>, List<String>/*optional
segments*/>> _serverInstanceToSegmentsMap;
private final List<String> _unavailableSegments;
private final int _numPrunedSegments;
- public RoutingTable(Map<ServerInstance, List<String>>
serverInstanceToSegmentsMap, List<String> unavailableSegments,
- int numPrunedSegments) {
+ public RoutingTable(Map<ServerInstance, Pair<List<String>, List<String>>>
serverInstanceToSegmentsMap,
Review Comment:
server side logic handles null, and I'll document that the contract is to
use null for empty optional segment list
--
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]