aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@oath.com>2018-08-29 14:06:41 +0200
committerJon Bratseth <bratseth@oath.com>2018-08-29 14:06:41 +0200
commitff75785574b30677ce17984551328990a991869e (patch)
tree85b7245827d2bc308b597e930bd14c476c5b2497 /container-search/src
parent89e6983eb08238e4912aeabb7b001ad966cfb23b (diff)
Be down initially
Before ths change containers used to come up in the initial VIP state of up ("in rotation") before having any information about downstream cløusters. This is problematic if the node determines that it should be down when learning the state of downstream clusters, especially when it is determining that it should be down due to failing to complete pings timely due to initialization load. This changes to starting in the down state. Crucially, this requires tracking the current state of clusters in a separate component such that the state survives reconfiguration and we avoid setting the state down briefly on each reconfiguration. In addition to the case where there are downstream clusters deciding the VIP state oif a container, there are two others: - There are no such clusters. In this case the VIP state will be up by default. - Some other component is explicitly deciding the VIP state. This commit makes that case clearer.
Diffstat (limited to 'container-search/src')
-rw-r--r--container-search/src/main/java/com/yahoo/search/dispatch/SearchCluster.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/dispatch/SearchCluster.java b/container-search/src/main/java/com/yahoo/search/dispatch/SearchCluster.java
index efce2fdac9c..a4d7a54a80e 100644
--- a/container-search/src/main/java/com/yahoo/search/dispatch/SearchCluster.java
+++ b/container-search/src/main/java/com/yahoo/search/dispatch/SearchCluster.java
@@ -182,7 +182,7 @@ public class SearchCluster implements NodeManager<SearchCluster.Node> {
node.setWorking(true);
if (usesDirectDispatchTo(node))
- vipStatus.addToRotation(this);
+ vipStatus.setInRotation(true);
}
/** Used by the cluster monitor to manage node status */
@@ -192,16 +192,16 @@ public class SearchCluster implements NodeManager<SearchCluster.Node> {
// Take ourselves out if we usually dispatch only to our own host
if (usesDirectDispatchTo(node))
- vipStatus.removeFromRotation(this);
+ vipStatus.setInRotation(false);
}
private void updateSufficientCoverage(Group group, boolean sufficientCoverage) {
// update VIP status if we direct dispatch to this group and coverage status changed
if (usesDirectDispatchTo(group) && sufficientCoverage != group.hasSufficientCoverage()) {
if (sufficientCoverage) {
- vipStatus.addToRotation(this);
+ vipStatus.setInRotation(true);
} else {
- vipStatus.removeFromRotation(this);
+ vipStatus.setInRotation(false);
}
}
group.setHasSufficientCoverage(sufficientCoverage);