aboutsummaryrefslogtreecommitdiffstats
path: root/controller-server
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2018-06-27 13:19:19 +0200
committerMartin Polden <mpolden@mpolden.no>2018-06-27 13:19:19 +0200
commit535bb05e309f34d9d944b6e7a78290793a5ea8c6 (patch)
treefc8af0abf2855ff8d729059c6ec0b7b9c6049650 /controller-server
parent9c1f55f862eb46743f41b2a55edc50d10a72c06f (diff)
Skip config convergence check for AWS
Diffstat (limited to 'controller-server')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/SystemApplication.java23
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/SystemUpgrader.java14
2 files changed, 24 insertions, 13 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/SystemApplication.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/SystemApplication.java
index 98ec05e563a..05ac311c514 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/SystemApplication.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/SystemApplication.java
@@ -3,7 +3,12 @@ package com.yahoo.vespa.hosted.controller.application;
import com.yahoo.config.provision.ApplicationId;
import com.yahoo.config.provision.NodeType;
+import com.yahoo.config.provision.RegionName;
+import com.yahoo.vespa.hosted.controller.Controller;
+import com.yahoo.vespa.hosted.controller.api.identifiers.DeploymentId;
import com.yahoo.vespa.hosted.controller.api.integration.configserver.Node;
+import com.yahoo.vespa.hosted.controller.api.integration.configserver.ServiceConvergence;
+import com.yahoo.vespa.hosted.controller.api.integration.zone.ZoneId;
import java.util.Arrays;
import java.util.List;
@@ -49,6 +54,20 @@ public enum SystemApplication {
return nodeType == NodeType.proxy;
}
+ /** Returns whether config for this application has converged in given zone */
+ public boolean configConvergedIn(ZoneId zone, Controller controller) {
+ if (!hasApplicationPackage()) {
+ return true;
+ }
+ // TODO: Remove this hack once Docker hosts are removed from zone-application.
+ if (isAws(zone.region())) {
+ return true; // Skip checking config convergence on AWS as Docker hosts do not have cloud config
+ }
+ return controller.configServer().serviceConvergence(new DeploymentId(id(), zone))
+ .map(ServiceConvergence::converged)
+ .orElse(false);
+ }
+
/** All known system applications */
public static List<SystemApplication> all() {
return Arrays.asList(values());
@@ -64,4 +83,8 @@ public enum SystemApplication {
return String.format("system application %s of type %s", id, nodeType);
}
+ private static boolean isAws(RegionName region) {
+ return region.value().startsWith("cd-aws-") || region.value().startsWith("aws-");
+ }
+
}
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/SystemUpgrader.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/SystemUpgrader.java
index e9dd093fae8..953e95e25c8 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/SystemUpgrader.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/SystemUpgrader.java
@@ -3,9 +3,7 @@ package com.yahoo.vespa.hosted.controller.maintenance;
import com.yahoo.component.Version;
import com.yahoo.vespa.hosted.controller.Controller;
-import com.yahoo.vespa.hosted.controller.api.identifiers.DeploymentId;
import com.yahoo.vespa.hosted.controller.api.integration.configserver.Node;
-import com.yahoo.vespa.hosted.controller.api.integration.configserver.ServiceConvergence;
import com.yahoo.vespa.hosted.controller.api.integration.zone.ZoneId;
import com.yahoo.vespa.hosted.controller.application.SystemApplication;
import com.yahoo.vespa.hosted.controller.versions.VespaVersion;
@@ -71,21 +69,11 @@ public class SystemUpgrader extends Maintainer {
if (convergedOn(target, application.dependencies(), zone)) {
deploy(target, application, zone);
}
- converged &= convergedOn(target, application, zone) & configConverged(application, zone);
+ converged &= convergedOn(target, application, zone) & application.configConvergedIn(zone, controller());
}
return converged;
}
- /** Returns whether config for given application has converged */
- private boolean configConverged(SystemApplication application, ZoneId zone) {
- if (!application.hasApplicationPackage()) {
- return true;
- }
- return controller().configServer().serviceConvergence(new DeploymentId(application.id(), zone))
- .map(ServiceConvergence::converged)
- .orElse(false);
- }
-
/** Deploy application on given version idempotently */
private void deploy(Version target, SystemApplication application, ZoneId zone) {
if (!wantedVersion(zone, application, target).equals(target)) {