summaryrefslogtreecommitdiffstats
path: root/container-search
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-09-18 22:17:33 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2019-09-18 22:17:33 +0200
commitdc9669ff0b7ea4d22c71c03ca63645ff73bffcc5 (patch)
tree12776a6e1f3334237c9fdfb21da146388bd80025 /container-search
parent94e11577a49ae35965e8fc11e8203aec51024930 (diff)
Add some clarifying comments.
Diffstat (limited to 'container-search')
-rw-r--r--container-search/src/main/java/com/yahoo/search/dispatch/searchcluster/SearchCluster.java5
1 files changed, 5 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 8cc8b7f0ffd..85cc16ade6f 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
@@ -228,8 +228,11 @@ public class SearchCluster implements NodeManager<Node> {
boolean isDirectDispatchGroupAndChange = usesDirectDispatchTo(group) && hasChanged;
group.setHasSufficientCoverage(sufficientCoverage);
if ((!isInRotation || isDirectDispatchGroupAndChange) && sufficientCoverage) {
+ // We will set this cluster in rotation if
+ // - not already in rotation and one group has sufficient coverage.
vipStatus.addToRotation(clusterId);
} else if (isDirectDispatchGroupAndChange) {
+ // We will take it out of rotation if the group is mandatory (direct dispatch to this group)
vipStatus.removeFromRotation(clusterId);
}
}
@@ -304,6 +307,8 @@ public class SearchCluster implements NodeManager<Node> {
trackGroupCoverageChanges(i, group, sufficientCoverage, averageDocumentsInOtherGroups);
}
if ( ! anyGroupsSufficientCoverage && (sumOfActiveDocuments == 0)) {
+ // If no groups have sufficient coverage (0 might be sufficient)
+ // and there are no documents in any groups, then we are down.
vipStatus.removeFromRotation(clusterId);
}
}