diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-11-23 13:44:41 +0100 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-11-23 13:44:41 +0100 |
commit | 6bb6ec30fb0a44a223bacb473de20ce260a663b3 (patch) | |
tree | 13c7afd11eed362a8bcab726f468a639b960d94d /container-search | |
parent | f82fe83ea8cdab7e190e917b9391b5f0c36a3351 (diff) |
Ensure you use the same invoker and loadbalancer for the same call.
Diffstat (limited to 'container-search')
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/dispatch/Dispatcher.java | 12 | ||||
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/dispatch/InvokerFactory.java | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/dispatch/Dispatcher.java b/container-search/src/main/java/com/yahoo/search/dispatch/Dispatcher.java index 3a198c3576a..41f3f5bdead 100644 --- a/container-search/src/main/java/com/yahoo/search/dispatch/Dispatcher.java +++ b/container-search/src/main/java/com/yahoo/search/dispatch/Dispatcher.java @@ -159,7 +159,6 @@ public class Dispatcher extends AbstractComponent { public void deconstruct() { // The clustermonitor must be shutdown first as it uses the invokerfactory through the searchCluster. clusterMonitor.shutdown(); - invokerFactory.release(); if (rpcResourcePool != null) { rpcResourcePool.close(); } @@ -171,7 +170,8 @@ public class Dispatcher extends AbstractComponent { public SearchInvoker getSearchInvoker(Query query, VespaBackEndSearcher searcher) { SearchCluster cluster = searchCluster; // Take a snapshot - SearchInvoker invoker = getSearchPathInvoker(query, searcher, cluster).orElseGet(() -> getInternalInvoker(query, searcher, cluster, loadBalancer)); + InvokerFactory factory = invokerFactory; + SearchInvoker invoker = getSearchPathInvoker(query, searcher, cluster, factory, maxHitsPerNode).orElseGet(() -> getInternalInvoker(query, searcher, cluster, loadBalancer, factory, maxHitsPerNode)); if (query.properties().getBoolean(com.yahoo.search.query.Model.ESTIMATE)) { query.setHits(0); @@ -181,7 +181,8 @@ public class Dispatcher extends AbstractComponent { } /** Builds an invoker based on searchpath */ - private Optional<SearchInvoker> getSearchPathInvoker(Query query, VespaBackEndSearcher searcher, SearchCluster cluster) { + private static Optional<SearchInvoker> getSearchPathInvoker(Query query, VespaBackEndSearcher searcher, SearchCluster cluster, + InvokerFactory invokerFactory, int maxHitsPerNode) { String searchPath = query.getModel().getSearchPath(); if (searchPath == null) return Optional.empty(); @@ -200,7 +201,8 @@ public class Dispatcher extends AbstractComponent { } } - private SearchInvoker getInternalInvoker(Query query, VespaBackEndSearcher searcher, SearchCluster cluster, LoadBalancer loadBalancer) { + private static SearchInvoker getInternalInvoker(Query query, VespaBackEndSearcher searcher, SearchCluster cluster, + LoadBalancer loadBalancer, InvokerFactory invokerFactory, int maxHitsPerNode) { Optional<Node> directNode = cluster.localCorpusDispatchTarget(); if (directNode.isPresent()) { Node node = directNode.get(); @@ -252,7 +254,7 @@ public class Dispatcher extends AbstractComponent { * * @return a modifiable set containing the single group to reject, or null otherwise */ - private Set<Integer> rejectGroupBlockingFeed(List<Group> groups) { + private static Set<Integer> rejectGroupBlockingFeed(List<Group> groups) { if (groups.size() == 1) return null; List<Group> groupsRejectingFeed = groups.stream().filter(Group::isBlockingWrites).toList(); if (groupsRejectingFeed.size() != 1) return null; diff --git a/container-search/src/main/java/com/yahoo/search/dispatch/InvokerFactory.java b/container-search/src/main/java/com/yahoo/search/dispatch/InvokerFactory.java index caeae9c2c1d..4b40dcf6c68 100644 --- a/container-search/src/main/java/com/yahoo/search/dispatch/InvokerFactory.java +++ b/container-search/src/main/java/com/yahoo/search/dispatch/InvokerFactory.java @@ -117,6 +117,4 @@ public abstract class InvokerFactory { return new SearchErrorInvoker(ErrorMessage.createBackendCommunicationError(down.toString()), coverage); } - public void release() {} - } |