diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-01-07 14:54:54 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2021-01-07 14:57:22 +0000 |
commit | bb98a536fa3e3efb92816981ec1424c7de2e70d9 (patch) | |
tree | 98bd4bcf8e7da800c184e5d32a57c57970742d0e /container-search/src/main/java/com/yahoo/search/dispatch/searchcluster/SearchCluster.java | |
parent | de747f7296327a96b5f298f7f0f3905f91dfb8ba (diff) |
Disable topk optimisation on dispatch when content distribution is severly skewed.
When the skew is too large the assumption that docs are evenly and randomly distributed hold.
The impact and is larger on smaller systems. In large systems the where this optimisation is more important,
the probabilitity of large skew will be less.
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/dispatch/searchcluster/SearchCluster.java')
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/dispatch/searchcluster/SearchCluster.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/dispatch/searchcluster/SearchCluster.java b/container-search/src/main/java/com/yahoo/search/dispatch/searchcluster/SearchCluster.java index 2f62b07ac04..56165ec150b 100644 --- a/container-search/src/main/java/com/yahoo/search/dispatch/searchcluster/SearchCluster.java +++ b/container-search/src/main/java/com/yahoo/search/dispatch/searchcluster/SearchCluster.java @@ -368,6 +368,12 @@ public class SearchCluster implements NodeManager<Node> { return workingNodes + nodesAllowedDown >= nodesInGroup; } + public boolean isGroupWellBalanced(OptionalInt groupId) { + if (groupId.isEmpty()) return false; + Group group = groups().get(groupId); + return (group != null) && group.isContentWellBalanced(); + } + /** * Calculate whether a subset of nodes in a group has enough coverage */ |