diff options
author | Valerij Fredriksen <valerij92@gmail.com> | 2019-06-07 18:52:31 +0200 |
---|---|---|
committer | Valerij Fredriksen <valerij92@gmail.com> | 2019-06-07 20:16:36 +0200 |
commit | 391662c6b11628c21e152c3a0cc24da98ab608ed (patch) | |
tree | 2698f5e8fceb19b703c12d98d390ca8dfaaab71c | |
parent | 4bd60def8eff2c61c41cce90473418a16b78b94e (diff) |
Remove infrastructure apps from OperatorChangeApplicationMaintainer and instead run InfrastructureProvisioner more often
2 files changed, 3 insertions, 13 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/NodeRepositoryMaintenance.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/NodeRepositoryMaintenance.java index 18ae7e17d6d..25549abe9ed 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/NodeRepositoryMaintenance.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/NodeRepositoryMaintenance.java @@ -174,7 +174,7 @@ public class NodeRepositoryMaintenance extends AbstractComponent { rebootInterval = Duration.ofDays(30); nodeRetirerInterval = Duration.ofMinutes(30); metricsInterval = Duration.ofMinutes(1); - infrastructureProvisionInterval = Duration.ofMinutes(3); + infrastructureProvisionInterval = Duration.ofMinutes(1); throttlePolicy = NodeFailer.ThrottlePolicy.hosted; loadBalancerExpiry = Duration.ofHours(1); reservationExpiry = Duration.ofMinutes(20); // Need to be long enough for deployment to be finished for all config model versions diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/OperatorChangeApplicationMaintainer.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/OperatorChangeApplicationMaintainer.java index 4c5310d69b6..46571fd0deb 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/OperatorChangeApplicationMaintainer.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/OperatorChangeApplicationMaintainer.java @@ -13,7 +13,6 @@ import java.time.Clock; import java.time.Duration; import java.time.Instant; import java.util.LinkedHashSet; -import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; @@ -30,8 +29,6 @@ import java.util.stream.Collectors; */ public class OperatorChangeApplicationMaintainer extends ApplicationMaintainer { - private static final ApplicationId ZONE_APPLICATION_ID = ApplicationId.from("hosted-vespa", "routing", "default"); - private final Clock clock; private Instant previousRun; @@ -47,9 +44,9 @@ public class OperatorChangeApplicationMaintainer extends ApplicationMaintainer { Instant windowEnd = clock.instant(); Instant windowStart = previousRun; previousRun = windowEnd; - return nodeRepository().getNodes().stream() + return nodeRepository().getNodes(NodeType.tenant).stream() .filter(node -> hasManualStateChangeSince(windowStart, node)) - .flatMap(node -> owner(node).stream()) + .flatMap(node -> node.allocation().map(Allocation::owner).stream()) .collect(Collectors.toCollection(LinkedHashSet::new)); } @@ -58,13 +55,6 @@ public class OperatorChangeApplicationMaintainer extends ApplicationMaintainer { .anyMatch(event -> event.agent() == Agent.operator && event.at().isAfter(instant)); } - private Optional<ApplicationId> owner(Node node) { - if (node.allocation().isPresent()) return node.allocation().map(Allocation::owner); - - // TODO: Remove after removing tenant hosts from zone-app - return node.type() == NodeType.host ? Optional.of(ZONE_APPLICATION_ID) : Optional.empty(); - } - /** * Deploy in the maintenance thread to avoid scheduling multiple deployments of the same application if it takes * longer to deploy than the (short) maintenance interval of this |