diff options
author | Håkon Hallingstad <hakon@verizonmedia.com> | 2021-03-23 11:56:24 +0100 |
---|---|---|
committer | Håkon Hallingstad <hakon@verizonmedia.com> | 2021-03-23 11:56:24 +0100 |
commit | 44f64849fdd2a0dc62e84eb701bae1216d0b2215 (patch) | |
tree | eb8700943c722c4e5bfc62714580025e01f49a5d /orchestrator/src/main | |
parent | 81871d3f99f2155b0d81b347b61ac685a7bbc13e (diff) |
Require 3 config server (and controller) hosts
We already require 3 config server (and controller) nodes, but it is not
sufficient to protect the hosts from being left with only 1 healthy host: Say
the config server host application contains 2 nodes. An upgrade of host-admin
on one of those nodes is allowed, since only the host is suspended and none of
the 2 nodes are down. This is fixed by handling config server hosts similar to
config servers: assume 3 nodes.
Diffstat (limited to 'orchestrator/src/main')
-rw-r--r-- | orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ClusterApiImpl.java | 5 | ||||
-rw-r--r-- | orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaClusterPolicy.java | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ClusterApiImpl.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ClusterApiImpl.java index 7417318c572..57dcb5f3069 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ClusterApiImpl.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ClusterApiImpl.java @@ -81,9 +81,10 @@ class ClusterApiImpl implements ClusterApi { servicesDownAndNotInGroup = servicesNotInGroup.stream().filter(this::serviceEffectivelyDown).collect(Collectors.toSet()); int serviceInstances = serviceCluster.serviceInstances().size(); - if (serviceCluster.isConfigServerLike() && serviceInstances < numberOfConfigServers) { + if ((serviceCluster.isConfigServerLike() || serviceCluster.isConfigServerHostLike()) && + serviceInstances < numberOfConfigServers) { missingServices = numberOfConfigServers - serviceInstances; - descriptionOfMissingServices = missingServices + " missing config server" + (missingServices > 1 ? "s" : ""); + descriptionOfMissingServices = missingServices + " missing " + serviceCluster.nodeDescription(missingServices > 1); } else { missingServices = 0; descriptionOfMissingServices = "NA"; diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaClusterPolicy.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaClusterPolicy.java index ff1c56f6b2f..47586425c1d 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaClusterPolicy.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaClusterPolicy.java @@ -1,6 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.orchestrator.policy; +import com.yahoo.vespa.applicationmodel.ClusterId; import com.yahoo.vespa.applicationmodel.ServiceType; import com.yahoo.vespa.flags.BooleanFlag; import com.yahoo.vespa.flags.FetchVector; @@ -149,7 +150,11 @@ public class HostedVespaClusterPolicy implements ClusterPolicy { return ConcurrentSuspensionLimitForCluster.ONE_NODE; } - if (clusterApi.serviceType().equals(ServiceType.HOST_ADMIN)) { + if (clusterApi.serviceType() == ServiceType.HOST_ADMIN) { + if (Set.of(ClusterId.CONFIG_SERVER_HOST, ClusterId.CONTROLLER_HOST).contains(clusterApi.clusterId())) { + return ConcurrentSuspensionLimitForCluster.ONE_NODE; + } + return ConcurrentSuspensionLimitForCluster.TWENTY_PERCENT; } |