diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2018-11-15 16:17:16 +0100 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2018-11-15 16:17:16 +0100 |
commit | 787b7a115ad2fea0658601c3ebee6bcdb74f2550 (patch) | |
tree | 79ea97d29e6f3aea31fabf7f15c5b2f259e5c9b3 /container-search/src/main/java/com/yahoo/search/dispatch/Dispatcher.java | |
parent | 8ece4a3e82807740081aa64ed620a4fc879696bb (diff) |
When pooling ClusterMonitors and SearchClusters you will add a cluster every time there is a reconfig.
As nothing will purge them, you both keep stuff alive forever and end up with more clusters that you have.
Hence the magic for not removing vipstatus when there are multiple clusters kick in preventing nodes being taken OOR.
Now it is using the ComponentId for identifying a cluster.
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/dispatch/Dispatcher.java')
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/dispatch/Dispatcher.java | 12 |
1 files changed, 2 insertions, 10 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 708d80d4969..39fc0d31681 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 @@ -49,22 +49,14 @@ public class Dispatcher extends AbstractComponent { private final RpcResourcePool rpcResourcePool; private final boolean multilevelDispatch; - public Dispatcher(DispatchConfig dispatchConfig, FS4ResourcePool fs4ResourcePool, int containerClusterSize, VipStatus vipStatus) { - this.searchCluster = new SearchCluster(dispatchConfig, fs4ResourcePool, containerClusterSize, vipStatus); + public Dispatcher(String clusterId, DispatchConfig dispatchConfig, FS4ResourcePool fs4ResourcePool, int containerClusterSize, VipStatus vipStatus) { + this.searchCluster = new SearchCluster(clusterId, dispatchConfig, fs4ResourcePool, containerClusterSize, vipStatus); this.loadBalancer = new LoadBalancer(searchCluster, dispatchConfig.distributionPolicy() == DispatchConfig.DistributionPolicy.ROUNDROBIN); this.rpcResourcePool = new RpcResourcePool(dispatchConfig); this.multilevelDispatch = dispatchConfig.useMultilevelDispatch(); } - /** For testing */ - public Dispatcher(Map<Integer, Client.NodeConnection> nodeConnections, Client client) { - this.searchCluster = null; - this.loadBalancer = new LoadBalancer(searchCluster, true); - this.rpcResourcePool = new RpcResourcePool(client, nodeConnections); - this.multilevelDispatch = false; - } - /** Returns the search cluster this dispatches to */ public SearchCluster searchCluster() { return searchCluster; |