aboutsummaryrefslogtreecommitdiffstats
path: root/controller-server/src/main
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2021-11-30 10:31:53 +0100
committerJon Marius Venstad <venstad@gmail.com>2021-11-30 10:31:53 +0100
commitdaef832e7805139337eb6926d3c4b33cd5e0696d (patch)
tree2e15b75a4c35f434d291420dd04b09f8f4906d01 /controller-server/src/main
parent1c3caafc1d8b877dfc390e425bb25cc473f56fa3 (diff)
Recompute change to avoid setting a change which triggers no jobs
Diffstat (limited to 'controller-server/src/main')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java
index 3892ceeddf9..4e8f17b6098 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java
@@ -277,8 +277,13 @@ public class DeploymentTrigger {
/** Overrides the given instance's platform and application changes with any contained in the given change. */
public void forceChange(ApplicationId instanceId, Change change) {
applications().lockApplicationOrThrow(TenantAndApplicationId.from(instanceId), application -> {
- applications().store(application.with(instanceId.instance(),
- instance -> instance.withChange(change.onTopOf(application.get().require(instanceId.instance()).change()))));
+ Change newChange = change.onTopOf(application.get().require(instanceId.instance()).change());
+ application = application.with(instanceId.instance(),
+ instance -> instance.withChange(newChange));
+ DeploymentStatus newStatus = jobs.deploymentStatus(application.get());
+ application = application.with(instanceId.instance(),
+ instance -> instance.withChange(remainingChange(instance, newStatus)));
+ applications().store(application);
});
}